/* The workspace's design tokens, knotless's (web/src/tokens.css there), under the same names: every rule in the workspace draws from these by name, a colour by what it is for, never by its hue. What can never apply here (diffs, highlighted code, badges' pins, knotless's own pages and themes) is left out; what only the workspace draws is at the end of each block. The scales stay; a colour is `light-dark()`, light's then dark's, so it follows the root's `color-scheme`: the system's light or dark, or the theme the person chose (lib/theme.ts writes its scheme on the root, and a palette's colours over these, the rest mixed from them below). The one breakpoint, which a custom property cannot name: 640px. Every colour that is text reads at 4.5:1 or better on what it is drawn on, in light, in dark and in every palette (harness/contrast.mjs checks the pairs harness/contrast.json names). */ :root { color-scheme: light dark; /* Hues, each meaning one thing wherever it shows. */ --green: light-dark(#1a7f37, #3fb950); --red: light-dark(#cf222e, #f85149); --purple: light-dark(#7048b5, #b39af0); --yellow: light-dark(#9a6700, #d29922); --gray: light-dark(#636363, #9198a1); /* Surfaces, from the page up: what is raised is darker in light, lighter in dark. */ --bg: light-dark(#fff, #111); --panel: light-dark(#fafafa, #161616); --soft: light-dark(#f4f4f4, #1a1a1a); --hover: var(--soft); --line: light-dark(#e8e8e8, #262626); /* Text: the body, then quieter for what is said about it, then quieter still. */ --fg: light-dark(#171717, #ededed); --mute: light-dark(#525252, #a1a1a1); --faint: light-dark(#6e6e6e, #848484); --on-solid: light-dark(#fff, #0d0e10); /* What acts: a primary button's fill and the text on it, and the edge of what has focus. A link is underlined in --link-line. */ --primary: #2563eb; --on-primary: #fff; --link-line: light-dark(#b4b4b4, #5a5a5a); /* The accent: what marks or measures rather than acts, such as the tab one is on, or the row a search picks. */ --accent: light-dark(#2f5fb3, #7aa7f0); --accent-soft: light-dark(#eaeff7, #222935); /* What is unread or new: a dot, not a fill. */ --unread: light-dark(#e5484d, #ff6369); /* A notice: what a reader should know before it bites. */ --notice: light-dark(#fff8c5, #3b3313); --notice-fg: light-dark(#6b4a00, #e3b341); --notice-track: light-dark(#f0e2a0, #5c4a14); /* What a colour is for, over the hues above: the pages take these, never a hue. */ --success: var(--green); --danger: var(--red); --attention: var(--yellow); --done: var(--purple); --neutral: var(--gray); /* What a pull, an issue, a check or a line is in, as knotless names them: the renderer's State and Diff draw with these (app.css). */ --open: var(--success); --merged: var(--done); --closed-pull: var(--danger); --closed-issue: var(--neutral); --running: var(--attention); /* Diffs: a line added or removed, its number, and a hunk's header. */ --ins: light-dark(#e6ffec, rgb(46 160 67 / 0.15)); --ins-n: light-dark(#ccffd8, rgb(63 185 80 / 0.3)); --del: light-dark(#ffebe9, rgb(248 81 73 / 0.1)); --del-n: light-dark(#ffd7d5, rgb(248 81 73 / 0.3)); --hunk: light-dark(#ddf4ff, rgb(56 139 253 / 0.1)); /* A menu row's mark (the renderer's Icon): a white glyph on a tint, the same in light and dark. */ --tint-green: #1a7f37; --tint-blue: #1c5aa6; --tint-purple: #7048b5; --tint-gray: #636363; --tint-yellow: #8a5d00; --tint-red: #c4212c; --tint-orange: #b34700; --on-tint: #fff; --shadow-pop: 0 8px 24px light-dark(rgb(0 0 0 / 0.12), rgb(0 0 0 / 0.5)), 0 1px 2px light-dark(rgb(0 0 0 / 0.06), transparent), 0 0 0 1px light-dark(transparent, rgb(255 255 255 / 0.02)); /* Behind a dialog, over the page. */ --scrim: light-dark(rgb(0 0 0 / 0.4), rgb(0 0 0 / 0.6)); --ring: 0 0 0 3px var(--ring-color); --ring-color: light-dark(rgb(37 99 235 / 0.2), rgb(37 99 235 / 0.4)); --border: 1px solid var(--line); /* Type. */ --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; --text-2xs: 11px; --text-xs: 12px; --text-sm: 13px; --text-base: 14px; --text-md: 15px; --text-lg: 16px; --text-xl: 18px; --text-2xl: 20px; --text-3xl: 24px; /* What is typed into a field: never under 16px on a phone, where iOS zooms the page in on a field with smaller text, and leaves it so. */ --text-field: var(--text-base); --leading: 1.55; --leading-tight: 1.25; --weight-normal: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700; --tracking-tight: -0.015em; /* Space, on a 4px grid. */ --space-0-5: 0.125rem; --space-1: 0.25rem; --space-1-5: 0.375rem; --space-2: 0.5rem; --space-2-5: 0.625rem; --space-3: 0.75rem; --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-16: 4rem; /* A box's inner edge, and the height of a row in one. */ --pad-x: var(--space-4); --row-y: var(--space-2-5); /* Corners: small things, controls and boxes, and pills. */ --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px; --radius-lg: 10px; --radius-full: 999px; /* An app's favicon, at 16px. */ --radius-icon: 3px; /* Sizes. */ --control: 32px; --control-sm: 28px; --icon: 16px; --icon-sm: 12px; /* A theme's swatch in its menu: a tile on its canvas. */ --swatch: 24px; --avatar: 20px; --avatar-md: 32px; --avatar-sm: 16px; --strip: 48px; --underline-offset: 3px; --z-menu: 5; --quick: 0.15s; /* A button's action under way: its spinner's stroke, and one turn. */ --spinner: 2px; --spin: 0.8s; /* The workspace's own. */ /* An agent's work: what it added glows, and its badge, in the notice's colours. */ --agent: light-dark(#d4a017, #e3b341); --agent-soft: var(--notice); --agent-fg: var(--notice-fg); /* A stronger edge than --line, for a field or a column that has focus nearby. */ --line-strong: light-dark(#cfcfcf, #3a3a3a); /* The strip's backdrop, under its columns. */ --canvas: light-dark(var(--soft), #0b0b0b); /* A chain of tiles opened one from another: one colour each, in turn. */ --chain-1: light-dark(#3a6fd8, #6b98f0); --chain-2: light-dark(#d4447a, #ec6a9b); --chain-3: light-dark(#2f9e6b, #4fc08d); --chain-4: light-dark(#c48a12, #e0a526); --chain-5: light-dark(#8b5cf6, #a78bfa); --chain-6: light-dark(#1b8a9e, #3bb5c9); /* The bar of tabs, the strip map's row under it, and a chip there one column of a third wide. */ --tabs: 44px; --map: 34px; --map-chip: 18px; --map-unit: 54px; /* The room between columns, and the ghost column at the strip's end. */ --gap: var(--space-3); --ghost: 9rem; /* A tab's name: the widest it shows before it is cut short. */ --tab-name: 12rem; /* What fades at the ends of a row that scrolls sideways (the tabs on a phone). */ --fade: var(--space-4); /* The mini player's words: the widest they show in the tab bar; its progress line. */ --now-playing: 13rem; --progress: 2px; /* The widest a menu, the palette and the share dialog open. */ --menu-width: 23rem; --palette-width: 36rem; --dialog-width: 30rem; /* The sign-in dialog, as knotless's. */ --dialog-narrow: 24rem; /* The theme editor and browser, wider for their colours and cards; a colour's #rrggbb field. */ --dialog-wide: 52rem; --hex: 6.5rem; /* The sign-in dialog's row of apps: an app's icon there, and one turn of the row running past. */ --app-icon: 40px; --apps-run: 60s; /* The signed-out page: the widest it runs, and its hero's words; its headline, and HUD's mark in its header. */ --page-width: 64rem; --hero-width: 40rem; --text-display: 2.5rem; --mark: 24px; /* An overview card's unit, the width of a third-wide column's card, at its largest: it shrinks, down to half, until every card shows. */ --card: 13rem; --glide: 0.26s; --ease: cubic-bezier(0.2, 0.75, 0.25, 1); /* The playground: the widths its preview draws a tile at (a column of the strip, a wide one, a phone's screen); its editors' pane, at its narrowest and its share of the page; the height the call's arguments' editor opens at, and the list of problems under the view's at its tallest. */ --preview-column: 420px; --preview-wide: 720px; --preview-phone: 390px; --editor-min: 24rem; --editor-share: 44%; --args-height: 9rem; --problems-height: 10rem; } /* A theme's palette (place.hud.defs#palette): lib/theme.ts writes its colours on the root as the tokens they are, with its scheme, and marks it `data-palette` (and the theme editor its own dialog so, drawn in the palette it makes). What is drawn over them is mixed from them here, a chain's colours are its own, in turn, and what it does not name (a tint) is its scheme's. */ [data-palette] { /* :root's names for its colours, named again, so an element drawn in a palette of its own (the editor's) takes them from that. */ --hover: var(--soft); --border: 1px solid var(--line); --open: var(--success); --merged: var(--done); --closed-pull: var(--danger); --closed-issue: var(--neutral); --running: var(--attention); --agent-soft: var(--notice); --agent-fg: var(--notice-fg); --ring: 0 0 0 3px var(--ring-color); --link-line: color-mix(in srgb, var(--fg) 35%, var(--bg)); --unread: var(--danger); --ring-color: color-mix(in srgb, var(--primary) 40%, transparent); --ins: color-mix(in srgb, var(--success) 14%, transparent); --ins-n: color-mix(in srgb, var(--success) 28%, transparent); --del: color-mix(in srgb, var(--danger) 12%, transparent); --del-n: color-mix(in srgb, var(--danger) 28%, transparent); --hunk: color-mix(in srgb, var(--accent) 12%, transparent); --notice-track: color-mix(in srgb, var(--attention) 35%, var(--bg)); /* Gold, as light's and dark's, drawn toward the palette's attention: never a warning's brown. */ --agent: color-mix(in srgb, var(--attention) 50%, light-dark(#d4a017, #e3b341)); --chain-1: var(--accent); --chain-2: var(--done); --chain-3: var(--success); --chain-4: var(--attention); --chain-5: var(--danger); --chain-6: var(--neutral); /* Its background darkened, so a shadow takes the theme's hue, never a glow. */ --shade: color-mix(in srgb, var(--bg) 30%, black); --shadow-pop: 0 8px 24px light-dark( color-mix(in srgb, var(--shade) 12%, transparent), color-mix(in srgb, var(--shade) 50%, transparent) ), 0 1px 2px color-mix(in srgb, var(--shade) 6%, transparent); --scrim: light-dark( color-mix(in srgb, var(--shade) 40%, transparent), color-mix(in srgb, var(--shade) 60%, transparent) ); } @media (max-width: 640px) { :root { --text-field: var(--text-lg); --text-display: 2rem; } }