/* @tldraw/editor */ .tl-container { width: 100%; height: 100%; font-size: 12px; /* Spacing */ --tl-space-1: 2px; --tl-space-2: 4px; --tl-space-3: 8px; --tl-space-4: 12px; --tl-space-5: 16px; --tl-space-6: 20px; --tl-space-7: 28px; --tl-space-8: 32px; --tl-space-9: 64px; --tl-space-10: 72px; /* Radius */ --tl-radius-0: 2px; --tl-radius-1: 4px; --tl-radius-2: 6px; --tl-radius-3: 9px; --tl-radius-4: 11px; /* * Canvas z-index * * .tl-canvas has `contain: strict` which creates its own stacking context. * background, grid, shapes, overlays, and blocker are all children of .tl-canvas, * so their z-indices are relative to the canvas, not the container. * * collaborators, watermark, and canvas-in-front are siblings of .tl-canvas * (outside it), so they compete with the UI layer (.tlui-layout at z-index 300). * canvas-in-front must be below the UI layer (300) to sit between * the canvas and the UI; collaborator cursors sit above canvas content * (and layers that anchor to it, like comment pins) but below the * in-front content and the UI panels. The watermark (a licensing element) * sits above that content so it can't be occluded, but still below the * in-front content and the UI. */ --tl-layer-canvas-hidden: -999999; --tl-layer-canvas-background: 100; --tl-layer-canvas-grid: 150; --tl-layer-collaborators: 245; --tl-layer-watermark: 248; --tl-layer-canvas-in-front: 250; --tl-layer-canvas-shapes: 300; --tl-layer-canvas-overlays: 500; --tl-layer-canvas-blocker: 10000; /* Canvas overlays z-index */ --tl-layer-overlays-collaborator-scribble: 10; --tl-layer-overlays-collaborator-brush: 20; --tl-layer-overlays-collaborator-shape-indicator: 30; --tl-layer-overlays-user-scribble: 40; --tl-layer-overlays-user-brush: 50; --tl-layer-overlays-user-snapline: 90; --tl-layer-overlays-selection-fg: 100; /* User handles need to be above selection edges / corners, matters for sticky note clone handles */ --tl-layer-overlays-user-handles: 105; --tl-layer-overlays-user-indicator-hint: 110; --tl-layer-overlays-collaborator-cursor-hint: 120; --tl-layer-overlays-collaborator-cursor: 130; /* Text editor z-index */ --tl-layer-text-container: 1; --tl-layer-text-content: 3; --tl-layer-text-editor: 4; /* Error fallback z-index */ --tl-layer-error-overlay: 1; --tl-layer-error-canvas: 2; --tl-layer-error-canvas-after: 3; --tl-layer-error-content: 4; /* Misc */ --tl-zoom: 1; --tl-tab-size: 2; /* Cursor SVGs */ --tl-cursor-none: none; --tl-cursor-default: url("data:image/svg+xml,") 12 8, default; --tl-cursor-pointer: url("data:image/svg+xml,") 14 10, pointer; --tl-cursor-cross: url("data:image/svg+xml,") 16 16, crosshair; --tl-cursor-comment: url("data:image/svg+xml,") 5 19, crosshair; --tl-cursor-move: url("data:image/svg+xml,") 16 16, move; --tl-cursor-grab: url("data:image/svg+xml,") 16 16, grab; --tl-cursor-grabbing: url("data:image/svg+xml,") 16 16, grabbing; --tl-cursor-text: url("data:image/svg+xml,") 4 10, text; --tl-cursor-zoom-in: url("data:image/svg+xml,") 16 16, zoom-in; --tl-cursor-zoom-out: url("data:image/svg+xml,") 16 16, zoom-out; /* These cursor values get programmatically overridden */ /* They're just here to help your editor autocomplete */ --tl-cursor: var(--tl-cursor-default); --tl-cursor-resize-edge: ew-resize; --tl-cursor-resize-corner: nesw-resize; --tl-cursor-ew-resize: ew-resize; --tl-cursor-ns-resize: ns-resize; --tl-cursor-nesw-resize: nesw-resize; --tl-cursor-nwse-resize: nwse-resize; --tl-cursor-rotate: pointer; --tl-cursor-nwse-rotate: pointer; --tl-cursor-nesw-rotate: pointer; --tl-cursor-senw-rotate: pointer; --tl-cursor-swne-rotate: pointer; --tl-scale: calc(1 / var(--tl-zoom)); /* fonts */ --tl-font-draw: 'tldraw_draw', sans-serif; --tl-font-sans: 'tldraw_sans', sans-serif; --tl-font-serif: 'tldraw_serif', serif; --tl-font-mono: 'tldraw_mono', monospace; /* text outline */ --tl-text-outline-a: calc(min(0.5, 1 / var(--tl-zoom)) * 2px); --tl-text-outline-b: calc(min(0.5, 1 / var(--tl-zoom)) * -2px); --tl-text-outline-reference: 0 var(--tl-text-outline-b) 0 var(--tl-color-background), 0 var(--tl-text-outline-a) 0 var(--tl-color-background), var(--tl-text-outline-b) var(--tl-text-outline-b) 0 var(--tl-color-background), var(--tl-text-outline-a) var(--tl-text-outline-b) 0 var(--tl-color-background), var(--tl-text-outline-a) var(--tl-text-outline-a) 0 var(--tl-color-background), var(--tl-text-outline-b) var(--tl-text-outline-a) 0 var(--tl-color-background); --tl-text-outline: var(--tl-text-outline-reference); /* own properties */ position: relative; inset: 0px; height: 100%; width: 100%; overflow: clip; color: var(--tl-color-text); } .tl-theme__light { /* Canvas */ --tl-color-selection-fill: hsl(210, 100%, 56%, 24%); --tl-color-selection-stroke: hsl(214, 84%, 56%); --tl-color-background: hsl(210, 20%, 98%); /* if you ever update --tl-color-background, update the hardcoded values in theme-init.js and globals.css they're there to make sure the background color matches the user's preference before the actual app loads*/ --tl-color-grid: hsl(0, 0%, 43%); /* UI */ --tl-color-low: hsl(204, 16%, 94%); --tl-color-low-border: hsl(204, 16%, 92%); --tl-color-muted-none: hsl(0, 0%, 0%, 0%); --tl-color-muted-0: hsl(0, 0%, 0%, 2%); --tl-color-muted-1: hsl(0, 0%, 0%, 10%); --tl-color-muted-2: hsl(0, 0%, 0%, 4.3%); --tl-color-hint: hsl(0, 0%, 0%, 5.5%); --tl-color-overlay: hsl(0, 0%, 0%, 20%); --tl-color-divider: hsl(0, 0%, 91%); --tl-color-panel: hsl(0, 0%, 99%); --tl-color-panel-contrast: hsl(0, 0%, 100%); --tl-color-panel-overlay: hsl(0, 0%, 100%, 82%); --tl-color-panel-transparent: hsla(0, 0%, 99%, 0%); --tl-color-selected: hsl(214, 84%, 56%); --tl-color-selected-contrast: hsl(0, 0%, 100%); --tl-color-focus: hsl(219, 65%, 50%); --tl-color-tooltip: hsla(200, 14%, 4%, 1); /* Text */ --tl-color-text: hsl(0, 0%, 0%); --tl-color-text-0: hsl(0, 0%, 11%); --tl-color-text-1: hsl(0, 0%, 18%); --tl-color-text-3: hsl(204, 4%, 45%); --tl-color-text-disabled: hsl(204, 4%, 55%); --tl-color-text-shadow: hsl(0, 0%, 100%); --tl-color-text-highlight: hsl(52, 100%, 50%); --tl-color-text-highlight-p3: color(display-p3 0.972 0.8205 0.05); /* Named */ --tl-color-primary: hsl(214, 84%, 56%); --tl-color-success: hsl(123, 46%, 34%); --tl-color-info: hsl(201, 98%, 41%); --tl-color-warning: hsl(27, 98%, 47%); --tl-color-danger: hsl(0, 90%, 43%); /* Shadows */ --tl-shadow-1: 0px 1px 2px hsl(0, 0%, 0%, 25%), 0px 1px 3px hsl(0, 0%, 0%, 9%); --tl-shadow-2: 0px 0px 2px hsl(0, 0%, 0%, 16%), 0px 2px 3px hsl(0, 0%, 0%, 24%), 0px 2px 6px hsl(0, 0%, 0%, 0.1), inset 0px 0px 0px 1px var(--tl-color-panel-contrast); --tl-shadow-3: 0px 1px 2px hsl(0, 0%, 0%, 28%), 0px 2px 6px hsl(0, 0%, 0%, 14%), inset 0px 0px 0px 1px var(--tl-color-panel-contrast); --tl-shadow-4: 0px 0px 3px hsl(0, 0%, 0%, 19%), 0px 5px 4px hsl(0, 0%, 0%, 16%), 0px 2px 16px hsl(0, 0%, 0%, 6%), inset 0px 0px 0px 1px var(--tl-color-panel-contrast); } .tl-theme__dark { /* Canvas */ --tl-color-selection-fill: hsl(209, 100%, 57%, 20%); --tl-color-selection-stroke: hsl(214, 84%, 56%); --tl-color-background: hsl(240, 5%, 6.5%); /* if you ever update --tl-color-background, update the hardcoded values in theme-init.js and globals.css they're there to make sure the background color matches the user's preference before the actual app loads*/ --tl-color-grid: hsl(0, 0%, 40%); /* UI */ --tl-color-low: hsl(260, 4.5%, 10.5%); --tl-color-low-border: hsl(207, 10%, 10%); --tl-color-muted-none: hsl(0, 0%, 100%, 0%); --tl-color-muted-0: hsl(0, 0%, 100%, 2%); --tl-color-muted-1: hsl(0, 0%, 100%, 10%); --tl-color-muted-2: hsl(0, 0%, 100%, 5%); --tl-color-hint: hsl(0, 0%, 100%, 7%); --tl-color-overlay: hsl(0, 0%, 0%, 50%); --tl-color-divider: hsl(240, 9%, 22%); --tl-color-panel: hsl(235, 6.8%, 13.5%); --tl-color-panel-contrast: hsl(245, 12%, 23%); --tl-color-panel-overlay: hsl(210, 10%, 24%, 82%); --tl-color-panel-transparent: hsla(235, 6.8%, 13.5%, 0%); --tl-color-selected: hsl(217, 89%, 61%); --tl-color-selected-contrast: hsl(0, 0%, 100%); --tl-color-focus: hsl(217, 76%, 80%); --tl-color-tooltip: hsla(0, 0%, 100%, 1); /* Text */ --tl-color-text: hsl(210, 17%, 98%); --tl-color-text-0: hsl(0, 9%, 94%); --tl-color-text-1: hsl(0, 0%, 85%); --tl-color-text-3: hsl(204, 4%, 75%); --tl-color-text-disabled: hsl(204, 4%, 50%); --tl-color-text-shadow: hsl(210, 13%, 18%); --tl-color-text-highlight: hsl(52, 100%, 41%); --tl-color-text-highlight-p3: color(display-p3 0.8078 0.6225 0.0312); /* Named */ --tl-color-primary: hsl(214, 84%, 56%); --tl-color-success: hsl(123, 38%, 57%); --tl-color-info: hsl(199, 92%, 56%); --tl-color-warning: hsl(36, 100%, 57%); --tl-color-danger: hsl(0, 82%, 66%); /* Shadows */ --tl-shadow-1: 0px 1px 2px hsl(0, 0%, 0%, 16.1%), 0px 1px 3px hsl(0, 0%, 0%, 22%), inset 0px 0px 0px 1px var(--tl-color-panel-contrast); --tl-shadow-2: 0px 1px 3px hsl(0, 0%, 0%, 66.6%), 0px 2px 6px hsl(0, 0%, 0%, 33%), inset 0px 0px 0px 1px var(--tl-color-panel-contrast); --tl-shadow-3: 0px 1px 3px hsl(0, 0%, 0%, 50%), 0px 2px 12px hsl(0, 0%, 0%, 50%), inset 0px 0px 0px 1px var(--tl-color-panel-contrast); } .tl-counter-scaled { transform: scale(var(--tl-scale)); transform-origin: top left; width: calc(100% * var(--tl-zoom)); height: calc(100% * var(--tl-zoom)); } .tl-container, .tl-container * { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; scrollbar-highlight-color: transparent; -webkit-user-select: none; user-select: none; box-sizing: border-box; outline: none; } .tl-container a { -webkit-touch-callout: initial; } .tl-container__focused { outline: 1px solid var(--tl-color-low); } /* The host for , last among the container's children. It's a position in the DOM rather than a box: `display: contents` keeps what it holds positioned against the container. */ .tl-portal-host { display: contents; } input, *[contenteditable], *[contenteditable] * { user-select: text; } /* --------------------- Canvas --------------------- */ .tl-canvas { position: absolute; inset: 0px; height: 100%; width: 100%; color: var(--tl-color-text); cursor: var(--tl-cursor); overflow: clip; content-visibility: auto; touch-action: none; contain: strict; } .tl-canvas__in-front { position: absolute; inset: 0; pointer-events: none; z-index: var(--tl-layer-canvas-in-front); } .tl-shapes { position: relative; z-index: var(--tl-layer-canvas-shapes); } .tl-svg-context { position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; pointer-events: none; } /* ------------------- Background ------------------- */ .tl-background__wrapper { z-index: var(--tl-layer-canvas-background); position: absolute; inset: 0px; height: 100%; width: 100%; } .tl-background { background-color: var(--tl-color-background); width: 100%; height: 100%; } /* --------------------- Grid Layer --------------------- */ .tl-grid { position: absolute; inset: 0px; width: 100%; height: 100%; touch-action: none; pointer-events: none; z-index: var(--tl-layer-canvas-grid); contain: strict; } .tl-grid-dot { fill: var(--tl-color-grid); } /* --------------------- Layers --------------------- */ .tl-html-layer { position: absolute; top: 0px; left: 0px; width: 1px; height: 1px; contain: layout style size; } /* The collaborator cursor layer: a sibling of .tl-canvas, above all canvas content, below the in-front layer (250) and the UI panels (300). Display-only — pointer events pass through. */ .tl-collaborators { position: absolute; inset: 0px; z-index: var(--tl-layer-collaborators); pointer-events: none; overflow: clip; contain: layout style size; } .tl-collaborators__item { position: absolute; top: 0px; left: 0px; overflow: visible; pointer-events: none; transform-origin: top left; } .tl-cursor { overflow: visible; } /* --------------- Overlay Stack --------------- */ /* -------------- Selection foreground -------------- */ .tl-selection__bg { position: absolute; top: 0px; left: 0px; transform-origin: top left; background-color: transparent; pointer-events: all; } .tl-transparent { fill: transparent; stroke: transparent; } .tl-hidden { opacity: 0; pointer-events: none; } /* -------------- Nametag / cursor chat ------------- */ .tl-nametag { position: absolute; top: 16px; left: 13px; width: fit-content; height: fit-content; max-width: 120px; padding: 3px 6px; white-space: nowrap; position: absolute; overflow: hidden; text-overflow: ellipsis; font-size: 12px; border-radius: var(--tl-radius-2); color: var(--tl-color-selected-contrast); } .tl-nametag-title { position: absolute; top: -2px; left: 13px; width: fit-content; height: fit-content; padding: 0px 6px; max-width: 120px; white-space: nowrap; position: absolute; overflow: hidden; text-overflow: ellipsis; font-size: 12px; text-shadow: var(--tl-text-outline); color: var(--tl-color-selected-contrast); } .tl-nametag-chat { position: absolute; top: 16px; left: 13px; width: fit-content; height: fit-content; color: var(--tl-color-selected-contrast); white-space: nowrap; position: absolute; padding: 3px 6px; font-size: 12px; opacity: 1; border-radius: var(--tl-radius-2); } .tl-cursor-chat { position: absolute; color: var(--tl-color-selected-contrast); white-space: nowrap; padding: 3px 6px; font-size: 12px; pointer-events: none; z-index: var(--tl-layer-cursor); margin-top: 16px; margin-left: 13px; opacity: 1; border: none; user-select: text; border-radius: var(--tl-radius-2); } .tl-cursor-chat .tl-cursor-chat__bubble { padding-right: 12px; } .tl-cursor-chat::selection { background: var(--tl-color-selected); color: var(--tl-color-selected-contrast); text-shadow: none; } .tl-cursor-chat::placeholder { color: var(--tl-color-selected-contrast); opacity: 0.7; } /* ---------------------- Text ---------------------- */ .tl-text-shape-label { position: relative; font-weight: normal; min-width: 1px; padding: 0px; margin: 0px; border: none; width: fit-content; height: fit-content; font-variant: normal; font-style: normal; pointer-events: all; white-space: pre-wrap; overflow-wrap: break-word; } .tl-plain-text-wrapper[data-isediting='true'] .tl-text-content { opacity: 0; } .tl-rich-text-wrapper[data-isediting='true'] .tl-text-content { display: none; } .tl-text { /* remove overflow from textarea on windows */ margin: 0px; padding: 0px; appearance: auto; background: none; border-image: none; border: 0px; caret-color: var(--tl-color-text); color: inherit; column-count: initial !important; display: inline-block; font-family: inherit; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size: inherit; font-stretch: 100%; font-style: inherit; font-variant: inherit; font-variation-settings: normal; font-weight: inherit; letter-spacing: inherit; line-height: inherit; outline: none; overflow-wrap: break-word; text-align: inherit; text-indent: 0px; text-rendering: auto; text-shadow: inherit; text-transform: none; white-space: pre-wrap; line-break: normal; word-spacing: 0px; word-wrap: break-word; writing-mode: horizontal-tb !important; } .tl-text-measure { z-index: var(--tl-layer-canvas-hidden); opacity: 0; visibility: hidden; /* pointer-events: all; */ /* opacity: 1; */ /* z-index: 99999; */ position: absolute; top: 0px; left: 0px; width: max-content; box-sizing: border-box; pointer-events: none; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; resize: none; border: none; user-select: none; contain: layout style paint; /* N.B. This property, while discouraged ("intended for Document Type Definition (DTD) designers") is necessary for ensuring correct mixed RTL/LTR behavior when exporting SVGs. */ unicode-bidi: plaintext; -webkit-user-select: none; } .tl-text-input, .tl-text-content { position: absolute; inset: 0px; height: 100%; width: 100%; min-width: 1px; min-height: 1px; outline: none; } .tl-text-content__wrapper { position: relative; width: fit-content; height: fit-content; display: flex; align-items: center; justify-content: center; pointer-events: none; min-height: auto; } .tl-text-content { overflow: visible; pointer-events: none; } .tl-text-input { resize: none; user-select: all; -webkit-user-select: text; cursor: var(--tl-cursor-text); } .tl-text-input:not(.tl-rich-text) { /* * Note: this `overflow: hidden` is key for scrollbars to not show up * plaintext/