Skip to content
Myr

styles.css

This file

Path

apps/web/src/styles.css

541 lines · 18.6 KiB · CSS

Last changed by

Carry a row's state on its mark, widen the inspector for its commands, and tell a landing as a sentence firstoscabrielbefore adoption9df5c38

History of this file

Take it

1@import "tailwindcss";2@import "shadcn/tailwind.css";34/* `prose` for rendered Markdown (a README, an ask's brief); its `dark:`5   variant is the media query below, like every other one here. */6@plugin "@tailwindcss/typography";78/*9  The web's tokens (DESIGN.md names each one and when to use it).1011  The world is a test certificate: every page is a report sheet on cool12  bond paper, ruled in one-pixel hairlines, with fields, a results row, and13  signatories (credit) kept apart from the instruments used (agents). Colour14  carries state and nothing else, always beside a word and a mark:1516  --landed    the change is on main (a certified result)17  --checking  the gate is running a stage now18  --waiting   passed or paused, waiting on a person or a parent ask19  --refused   a refusal (nonconformance); the one rubric colour20  --sealed    held-back checks, layers and sealed evidence21  --muted     not reached, not needed, secondary text2223  Everything else is neutral: controls are ruled in --input, placeholders24  in --skeleton, code is drawn in the low-chroma --syntax-* colours, and a25  diff's added and removed lines in teal and rose (--diff-*), a family of26  their own, so a deletion never reads as a refusal or an addition as a27  landing. test/tokens.test.ts measures every pair that must hold.2829  Light and dark follow the system setting (no toggle, no script, no flash):30  shadcn's `dark:` variant is the media query, not a class.31*/32@custom-variant dark (@media (prefers-color-scheme: dark));3334/*35  Until a face arrives (font-display: swap), text is drawn in a local face36  scaled to its metrics, so the swap moves nothing: Arial (or its metric37  twin Liberation Sans) for Public Sans, Courier New (or Liberation Mono)38  for JetBrains Mono. Measured in Chromium from the latin files: Public Sans39  sets 103.89% wider than Arial, ascent 0.95 em and descent 0.225 em;40  JetBrains Mono sets as wide as Courier New, ascent 1.02 em and descent41  0.3 em. Each override is the face's metric over its size-adjust.42*/43@font-face {44  font-family: "Public Sans Fallback";45  src:46    local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo");47  size-adjust: 103.89%;48  ascent-override: 91.45%;49  descent-override: 21.66%;50  line-gap-override: 0%;51}5253@font-face {54  font-family: "JetBrains Mono Fallback";55  src:56    local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono"),57    local("Cousine");58  size-adjust: 99.98%;59  ascent-override: 102.02%;60  descent-override: 30%;61  line-gap-override: 0%;62}6364@font-face {65  font-family: "Public Sans";66  font-style: normal;67  font-weight: 100 900;68  font-display: swap;69  src: url("./assets/fonts/public-sans-latin.woff2") format("woff2");70  unicode-range:71    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,72    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,73    U+2215, U+FEFF, U+FFFD;74}7576@font-face {77  font-family: "Public Sans";78  font-style: normal;79  font-weight: 100 900;80  font-display: swap;81  src: url("./assets/fonts/public-sans-latin-ext.woff2") format("woff2");82  unicode-range:83    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,84    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,85    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;86}8788@font-face {89  font-family: "JetBrains Mono";90  font-style: normal;91  font-weight: 100 800;92  font-display: swap;93  src: url("./assets/fonts/jetbrains-mono-latin.woff2") format("woff2");94  unicode-range:95    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,96    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,97    U+2215, U+FEFF, U+FFFD;98}99100@font-face {101  font-family: "JetBrains Mono";102  font-style: normal;103  font-weight: 100 800;104  font-display: swap;105  src: url("./assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");106  unicode-range:107    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,108    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,109    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;110}111112:root {113  color-scheme: light dark;114115  /* Paper, ink and rules. The paper is hex: the theme-color meta and the116     manifest repeat it (src/features/shared/theme.ts, held by a test). */117  --background: #f5f8fa;118  --foreground: oklch(0.21 0.015 258);119  --surface: oklch(0.955 0.005 245);120  /* One step past the surface, for a selected thing under the pointer only121     (DESIGN.md "Pressed Surface"); every state role keeps 5:1 on it. */122  --surface-2: oklch(0.935 0.006 250);123  --muted: oklch(0.48 0.012 258);124  --rule: oklch(0.86 0.007 255);125  --rule-strong: oklch(0.21 0.015 258);126127  /* State roles: text-safe on paper, on surface and on surface-2 (at least 5:1). */128  --landed: oklch(0.47 0.11 155);129  --checking: oklch(0.48 0.13 252);130  --waiting: oklch(0.5 0.1 70);131  --refused: oklch(0.5 0.18 27);132  --sealed: oklch(0.46 0.13 305);133134  /* A control's border at 3:1 on paper (WCAG 2.2 SC 1.4.11), and the135     stroke of a placeholder that holds a row's place. */136  --input: oklch(0.62 0.01 258);137  --skeleton: oklch(0.8 0.008 255);138139  /* Code: ink carries keywords, names and calls; strings lean teal and140     constants olive, both too grey to be mistaken for a state. Each keeps141     4.5:1 on a changed word's tint as well as on the paper. */142  --syntax-keyword: var(--foreground);143  --syntax-function: var(--foreground);144  --syntax-parameter: var(--foreground);145  --syntax-string: oklch(0.42 0.035 200);146  --syntax-constant: oklch(0.42 0.035 110);147  /* A step darker than muted: a changed word's tint sits under these, and148     they keep 4.5:1 on it too. */149  --syntax-comment: oklch(0.42 0.012 258);150  --syntax-punctuation: oklch(0.42 0.012 258);151  --syntax-link: var(--syntax-string);152153  /* A diff's lines. The sign colour draws the + and -, the bars and a154     changed line's number; the line's tint is that colour mixed into the155     paper as Pierre mixes it (12% here, 20% in the dark), so a server's156     plain-text diff can match the drawing; emphasis marks the changed157     words. */158  --diff-add-sign: oklch(0.51 0.09 195);159  --diff-add-bg: color-mix(in lab, var(--background) 88%, var(--diff-add-sign));160  --diff-add-emphasis: color-mix(161    in oklab,162    var(--diff-add-sign) 18%,163    transparent164  );165  --diff-del-sign: oklch(0.51 0.12 345);166  --diff-del-bg: color-mix(in lab, var(--background) 88%, var(--diff-del-sign));167  --diff-del-emphasis: color-mix(168    in oklab,169    var(--diff-del-sign) 18%,170    transparent171  );172173  /* shadcn's names, mapped onto the roles above. */174  --card: var(--background);175  --card-foreground: var(--foreground);176  --popover: oklch(0.995 0.002 240);177  --popover-foreground: var(--foreground);178  --primary: var(--foreground);179  --primary-foreground: var(--background);180  --secondary: var(--surface);181  --secondary-foreground: var(--foreground);182  --muted-foreground: var(--muted);183  --accent: var(--surface);184  --accent-foreground: var(--foreground);185  --destructive: var(--refused);186  --border: var(--rule);187  --ring: var(--foreground);188  --radius: 0.125rem;189}190191@media (prefers-color-scheme: dark) {192  :root {193    --background: #0e1114;194    --foreground: oklch(0.94 0.005 258);195    --surface: oklch(0.215 0.009 258);196    --surface-2: oklch(0.25 0.01 258);197    --muted: oklch(0.72 0.01 258);198    --rule: oklch(0.33 0.01 258);199    --rule-strong: oklch(0.94 0.005 258);200201    --landed: oklch(0.78 0.13 155);202    --checking: oklch(0.76 0.11 250);203    --waiting: oklch(0.82 0.12 78);204    --refused: oklch(0.73 0.15 25);205    --sealed: oklch(0.76 0.11 305);206207    --input: oklch(0.55 0.01 258);208    --skeleton: oklch(0.36 0.01 258);209210    --syntax-string: oklch(0.8 0.035 200);211    --syntax-constant: oklch(0.82 0.035 110);212    --syntax-comment: var(--muted);213    --syntax-punctuation: var(--muted);214215    --diff-add-sign: oklch(0.74 0.08 195);216    --diff-add-bg: color-mix(217      in lab,218      var(--background) 80%,219      var(--diff-add-sign)220    );221    --diff-add-emphasis: color-mix(222      in oklab,223      var(--diff-add-sign) 26%,224      transparent225    );226    --diff-del-sign: oklch(0.72 0.1 345);227    --diff-del-bg: color-mix(228      in lab,229      var(--background) 80%,230      var(--diff-del-sign)231    );232    --diff-del-emphasis: color-mix(233      in oklab,234      var(--diff-del-sign) 26%,235      transparent236    );237238    --popover: oklch(0.235 0.009 258);239  }240}241242/*243  The shell's widths, by name: a phone below `tablet`; from `tablet` a top244  bar with the rail as a sheet; from `diffsplit` a diff may go side by245  side; from `shell` (1120 px, so the 110% zoom of a 1280 frame keeps it)246  the rail and the inspector are columns; from `codefacts` code pages keep247  the inspector open beside the code.248*/249@theme {250  --breakpoint-tablet: 40rem;251  --breakpoint-diffsplit: 48rem;252  --breakpoint-shell: 70rem;253  --breakpoint-codefacts: 90rem;254}255256@theme inline {257  --font-sans:258    "Public Sans", "Public Sans Fallback", ui-sans-serif, system-ui,259    -apple-system, "Segoe UI", sans-serif;260  --font-mono:261    "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, "SFMono-Regular",262    "Cascadia Mono", Menlo, monospace;263264  /*265    The type scale, by role: a fixed rem scale, nothing fluid, and nothing266    under 13 px. Mono is only for what a terminal prints or takes; its267    three lines are inline (the token's own), a transcript268    (`leading-terminal`) and code (`leading-code`, Pierre's 20 px).269  */270  --text-headline: 1.5rem;271  --text-headline--line-height: 2rem;272  --text-headline--letter-spacing: -0.015em;273  --text-headline--font-weight: 600;274  --text-title: 1.1875rem;275  --text-title--line-height: 1.6rem;276  --text-title--letter-spacing: -0.01em;277  --text-title--font-weight: 600;278  --text-want: 1rem;279  --text-want--line-height: 1.5rem;280  --text-body: 1rem;281  --text-body--line-height: 1.55rem;282  --text-ui: 0.875rem;283  --text-ui--line-height: 1.3rem;284  --text-label: 0.8125rem;285  --text-label--line-height: 1.15rem;286  --text-label--font-weight: 500;287  --text-mono: 0.8125rem;288  --text-mono--line-height: 1.25rem;289  --leading-terminal: 1.5rem;290  --leading-code: 20px;291292  /* The earlier scale, which pages written before the one above still use. */293  --text-xs: 0.75rem;294  --text-xs--line-height: 1.1rem;295  --text-sm: 0.875rem;296  --text-sm--line-height: 1.35rem;297  --text-base: 1rem;298  --text-base--line-height: 1.55rem;299  --text-lg: 1.1875rem;300  --text-lg--line-height: 1.65rem;301  --text-xl: 1.4375rem;302  --text-xl--line-height: 1.9rem;303  --text-2xl: 1.75rem;304  --text-2xl--line-height: 2.2rem;305306  --color-background: var(--background);307  --color-foreground: var(--foreground);308  --color-surface: var(--surface);309  --color-surface-2: var(--surface-2);310  --color-rule: var(--rule);311  --color-rule-strong: var(--rule-strong);312  --color-landed: var(--landed);313  --color-checking: var(--checking);314  --color-waiting: var(--waiting);315  --color-refused: var(--refused);316  --color-sealed: var(--sealed);317  --color-skeleton: var(--skeleton);318  --color-diff-add-sign: var(--diff-add-sign);319  --color-diff-add-bg: var(--diff-add-bg);320  --color-diff-add-emphasis: var(--diff-add-emphasis);321  --color-diff-del-sign: var(--diff-del-sign);322  --color-diff-del-bg: var(--diff-del-bg);323  --color-diff-del-emphasis: var(--diff-del-emphasis);324  --color-muted: var(--surface);325  --color-muted-foreground: var(--muted-foreground);326327  --color-card: var(--card);328  --color-card-foreground: var(--card-foreground);329  --color-popover: var(--popover);330  --color-popover-foreground: var(--popover-foreground);331  --color-primary: var(--primary);332  --color-primary-foreground: var(--primary-foreground);333  --color-secondary: var(--secondary);334  --color-secondary-foreground: var(--secondary-foreground);335  --color-accent: var(--accent);336  --color-accent-foreground: var(--accent-foreground);337  --color-destructive: var(--destructive);338  --color-border: var(--border);339  --color-input: var(--input);340  --color-ring: var(--ring);341342  --radius-sm: calc(var(--radius) * 0.5);343  --radius-md: var(--radius);344  --radius-lg: calc(var(--radius) * 2);345  --radius-xl: calc(var(--radius) * 3);346347  /* A landing's mark settles once, like a stamp. */348  --animate-stamp: stamp 420ms cubic-bezier(0.16, 1, 0.3, 1) 1 both;349350  @keyframes stamp {351    from {352      opacity: 0;353      transform: scale(1.35);354    }355    to {356      opacity: 1;357      transform: scale(1);358    }359  }360}361362@layer base {363  * {364    @apply border-border outline-ring/50;365  }366367  html {368    -webkit-text-size-adjust: 100%;369    scrollbar-color: var(--rule) transparent;370    text-rendering: optimizeLegibility;371  }372373  body {374    @apply bg-background text-foreground font-sans antialiased;375    caret-color: var(--checking);376  }377378  /* On a phone a decision's choices are a bar fixed above the bottom bar379     (decision/choices.tsx): main keeps room for it at its foot, so the380     page's last lines scroll clear of it. */381  @media (width < 40rem) {382    main:has([data-choices-bar]) {383      padding-bottom: 10rem;384    }385  }386387  ::selection {388    background: color-mix(in oklch, var(--checking) 22%, transparent);389    color: var(--foreground);390  }391392  a {393    text-underline-offset: 0.2em;394    text-decoration-thickness: 1px;395  }396397  :focus-visible {398    outline: 2px solid var(--ring);399    outline-offset: 2px;400  }401402  /* Code shows what was typed: `=>` stays two characters. */403  code,404  kbd,405  samp,406  pre {407    font-feature-settings:408      "calt" 0,409      "liga" 0;410  }411412  time,413  td,414  th {415    font-variant-numeric: tabular-nums;416  }417418  /*419    Pierre draws code inside shadow roots: `diffs-container` (@pierre/diffs)420    and `file-tree-container` (@pierre/trees). Each reads these variables421    from its host, so setting them here maps both onto the tokens above,422    and both follow the media-query dark mode with them. Nothing outside423    them reaches in: the `code` rule above stops at the shadow root, so the424    ligatures are switched off again here.425  */426  diffs-container {427    /* Metrics: the mono token on Pierre's 20 px line. */428    --diffs-font-family: var(--font-mono);429    --diffs-font-size: 0.8125rem;430    --diffs-line-height: 20px;431    --diffs-font-features: "calt" 0, "liga" 0;432    --diffs-tab-size: 2;433    --diffs-header-font-family: var(--font-sans);434435    /* The ground: code sits on the paper, gutter and all. */436    --diffs-background: var(--background);437    --diffs-foreground: var(--foreground);438    --diffs-bg-context-override: var(--background);439    --diffs-bg-context-gutter-override: var(--background);440    --diffs-bg-separator-override: var(--surface);441    --diffs-fg-number-override: var(--muted);442    /* Pierre mixes a few percent of this into a hovered line, which lands443       on the surface's tone in both schemes. */444    --diffs-bg-hover-override: var(--foreground);445    /* The viewer's own selection, checking's hue, as text selection is;446       Pierre mixes it into the line at about a fifth. */447    --diffs-bg-selection-override: var(--checking);448    --diffs-bg-selection-number-override: var(--checking);449450    /* The token theme (features/code/pierre.ts) reads these. */451    --diffs-token-keyword: var(--syntax-keyword);452    --diffs-token-function: var(--syntax-function);453    --diffs-token-parameter: var(--syntax-parameter);454    --diffs-token-string: var(--syntax-string);455    --diffs-token-string-expression: var(--syntax-string);456    --diffs-token-constant: var(--syntax-constant);457    --diffs-token-comment: var(--syntax-comment);458    --diffs-token-punctuation: var(--syntax-punctuation);459    --diffs-token-link: var(--syntax-link);460461    /* A diff's lines, in its own tints. Pierre mixes a changed line's462       background (and its number's) from the sign colour, as --diff-add-bg463       says, so the line backgrounds take no override of their own: Pierre464       also draws a deletion's bar in dashes of that background and the465       sign, and an override set to the sign would make the bar solid, so a466       deletion would differ from an addition by colour alone. */467    --diffs-addition-color-override: var(--diff-add-sign);468    --diffs-bg-addition-emphasis-override: var(--diff-add-emphasis);469    --diffs-deletion-color-override: var(--diff-del-sign);470    --diffs-bg-deletion-emphasis-override: var(--diff-del-emphasis);471    --diffs-modified-color-override: var(--muted);472  }473474  file-tree-container {475    /* A tree is read like a list, in the UI's own face and size. */476    --trees-font-family-override: var(--font-sans);477    --trees-font-size-override: 0.875rem;478    --trees-bg-override: var(--background);479    --trees-bg-muted-override: var(--surface);480    --trees-fg-override: var(--foreground);481    --trees-fg-muted-override: var(--muted);482    --trees-input-bg-override: var(--background);483    --trees-border-color-override: var(--input);484    --trees-border-radius-override: var(--radius);485    --trees-accent-override: var(--foreground);486    --trees-focus-ring-color-override: var(--ring);487    --trees-selected-bg-override: var(--surface);488    --trees-selected-fg-override: var(--foreground);489    /* One colour for every file's icon: a file's kind is not a state. */490    --trees-file-icon-color: var(--muted);491    /* A commit's changes, in the diff's tints; a change in place is muted. */492    --trees-status-added-override: var(--diff-add-sign);493    --trees-status-deleted-override: var(--diff-del-sign);494    --trees-status-modified-override: var(--muted);495    --trees-status-renamed-override: var(--muted);496    --trees-status-untracked-override: var(--muted);497    --trees-status-ignored-override: var(--muted);498    --trees-git-added-color-override: var(--diff-add-sign);499    --trees-git-deleted-color-override: var(--diff-del-sign);500    --trees-git-modified-color-override: var(--muted);501    --trees-git-renamed-color-override: var(--muted);502    --trees-git-untracked-color-override: var(--muted);503    --trees-git-ignored-color-override: var(--muted);504  }505506  @media (prefers-reduced-motion: reduce) {507    *,508    ::before,509    ::after {510      animation-duration: 0.01ms !important;511      animation-iteration-count: 1 !important;512      transition-duration: 0.01ms !important;513    }514  }515}516517/*518  Rendered Markdown (a README, a `.md` file) in the page's colours: the519  typography plugin's palette, every role mapped to a token, so one set of520  classes serves both schemes (features/markdown/markdown.tsx).521*/522@utility prose-tokens {523  --tw-prose-body: var(--foreground);524  --tw-prose-headings: var(--foreground);525  --tw-prose-lead: var(--muted);526  --tw-prose-links: var(--foreground);527  --tw-prose-bold: var(--foreground);528  --tw-prose-counters: var(--muted);529  --tw-prose-bullets: var(--muted);530  --tw-prose-hr: var(--rule);531  --tw-prose-quotes: var(--muted);532  --tw-prose-quote-borders: var(--rule);533  --tw-prose-captions: var(--muted);534  --tw-prose-kbd: var(--foreground);535  --tw-prose-kbd-shadows: var(--rule);536  --tw-prose-code: var(--foreground);537  --tw-prose-pre-code: var(--foreground);538  --tw-prose-pre-bg: var(--surface);539  --tw-prose-th-borders: var(--input);540  --tw-prose-td-borders: var(--rule);541}