@putdotio/design 5.1.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/DESIGN.md CHANGED
@@ -78,7 +78,7 @@ Tier 1, 3, and 4 cards are Components (put.io owns the recipe); tier 2 cards are
78
78
 
79
79
  ## Colors
80
80
 
81
- - Yellow `#FDCE45` (`--yellow-solid`) is the brand value in both modes: brand mark, primary actions, folder and file emphasis, progress, focus. Hover is `--yellow-solid-hover`.
81
+ - Yellow `#FDCE45` (`--yellow-solid`) is the brand value in both modes: brand mark, primary actions, folder and file emphasis, progress. Hover is `--yellow-solid-hover`.
82
82
  - Every yellow is one of these tokens, flat. Yellow text on light surfaces is `--yellow-text-secondary`.
83
83
  - Dark is the default product mode; light serves landing pages, docs, and states that read better light.
84
84
  - Red, green, and neutral come from their token scales.
@@ -90,7 +90,7 @@ Tier 1, 3, and 4 cards are Components (put.io owns the recipe); tier 2 cards are
90
90
  - TV product UI has no mono face (a debug overlay may use the platform's system monospace): 10-foot numerics use GT America `tnum`. Platforms without OpenType feature selection (Roku: `Font` takes only `uri` and `size`) get proportional figures, so budget timecodes for reflow (`1` is 399/1000 em, `0` is 636).
91
91
  - GT America is Latin only (523 codepoints, Western and Central European plus Turkish, no dingbats such as `✓` `▶` `★`). Symbols are icons. Text that can hold a filename keeps a fallback family; web falls back per glyph, while one-font-per-label platforms must ship a fallback or render `.notdef` boxes.
92
92
  - The root is the browser default, `100%` (16px), so text follows the reader's setting. Components choose a text role, not a size step: `--fs-ui` (14px) for UI chrome (labels, buttons, nav, links, errors), `--fs-body` (16px) for body and long text, `--fs-caption` (12px) for captions, and `--fs-field` (16px) for typed text, which keeps iOS Safari from zooming on focus.
93
- - The steps are rem on Tailwind's 16px scale: `--fs-xs` 12px, `--fs-sm` 14, `--fs-base` 16, `--fs-md` 18, `--fs-lg` 24, `--fs-xl` 32, `--fs-2xl` 48, `--fs-3xl` 64, `--fs-display` 96. Screen titles and one-time-code digits take `--fs-title` (22px) on a 30px line with `--tracking-snug`; the code separator is `--fs-md`.
93
+ - The steps are rem on Tailwind's 16px scale: `--fs-xs` 12px, `--fs-sm` 14, `--fs-base` 16, `--fs-md` 18, `--fs-lg` 24, `--fs-xl` 32, `--fs-2xl` 48, `--fs-3xl` 64, `--fs-display` 96. Screen titles take `--fs-title` (22px) on a 30px line with `--tracking-snug`. One-time-code digits take `--fs-title` in mono; the code separator is `--fs-md`.
94
94
 
95
95
  ## Layout & Spacing
96
96
 
@@ -101,7 +101,7 @@ Tier 1, 3, and 4 cards are Components (put.io owns the recipe); tier 2 cards are
101
101
 
102
102
  ## Elevation & Depth
103
103
 
104
- Borders and soft shadows mark interaction: popovers, modals, menus, TV focus, drag and drop targets. Glow belongs only to focused TV states.
104
+ Borders and soft shadows mark interaction: popovers, modals, menus, TV focus, drag and drop targets. Nothing glows; TV focus is a fill.
105
105
 
106
106
  ## Shapes
107
107
 
@@ -116,7 +116,8 @@ Default radius `6px`; `4px` for tight controls, `8px` or `10px` for panels, pill
116
116
  - **Primary:** `--button-primary-bg`, hover `--button-primary-bg-hover`, label `--button-primary-fg`. At most one per action group.
117
117
  - **Secondary:** `--button-default-bg` plus a `--border` border; hover steps both (`--button-default-bg-hover`, `--border-hover`).
118
118
  - **Ghost:** text only, `--button-ghost-fg`; hover adds `--button-ghost-bg-hover` and lifts the label to `--button-ghost-fg-hover`. Use it for anything quieter than secondary: header `Sign in`, toolbar actions, `Cancel` beside a confirm, icon-only buttons.
119
- - **Disabled:** submit buttons are never disabled at rest; the submit validates. A filled button is disabled only while its action runs (with a spinner) or once it is done, so it keeps its own fill and label at full opacity; a finished 2FA “Verified” is a `.btn-success` with `data-state="success"`. Secondary and quiet buttons drop their text to `--solid` at full opacity.
119
+ - **Disabled:** `:disabled` and `aria-disabled="true"` read the same. Submit buttons are never disabled at rest; the submit validates. A filled button is disabled only while its action runs (with a spinner) or once it is done, so it keeps its own fill and label at full opacity; a finished 2FA “Verified” is a `.btn-success` with `data-state="success"`. Secondary and quiet buttons drop their text to `--solid` at full opacity.
120
+ - **Hover:** only under `(hover: hover) and (pointer: fine)`, so a tap never leaves a button lit.
120
121
  - **Focus:** `--shadow-focus`, a 2px `--bg` gap then a 2px `--solid-hover` ring, at least 3:1 against the page and panels in both modes.
121
122
  - A bordered button always fills (secondary). Border-only buttons read smaller beside solid fills and vanish on dark.
122
123
  - Four sizes share one box per size across tiers: default 36px, `md` 32px, `sm` 28px, `xs` 24px. Read `--button-height*`, `--button-padding-x*`, `--button-label-size*`, `--button-tracking*`, `--button-icon-size`, `--button-gap`.
@@ -135,14 +136,14 @@ Default radius `6px`; `4px` for tight controls, `8px` or `10px` for panels, pill
135
136
 
136
137
  ### Auth
137
138
 
138
- - Sign in, sign up, password reset, and two-factor pages have no card or panel: the form sits on `--bg`. Recipe: `.auth-page`, `.auth-header`, `.auth-main`, `.auth-column`, `.auth-title`, `.auth-note`, `.auth-actions`, `.auth-links`, `.auth-footer`.
139
+ - Sign in, sign up, password reset, and two-factor pages have no card or panel: the form sits on `--bg`. Recipe: `.auth-page`, `.auth-header`, `.auth-logo`, `.auth-main`, `.auth-column`, `.auth-title`, `.auth-note`, `.auth-actions`, `.auth-links`, `.auth-footer`.
139
140
  - The logo sits top-left in the header, in a `30.33px` box (26px ink × 7/6). The top right stays empty by default.
140
141
  - One left-aligned column, up to `340px`, is centred horizontally and optically centred vertically: the form's middle sits near 45% of the viewport height, never below the true middle.
141
142
  - A quiet centred footer links Terms of Service, Privacy Policy, and Help in muted `--fs-caption`, separated by middots, 16px above the page bottom.
142
143
  - Text is one size: labels, hints, `.auth-note` lines, errors, and the link row take `--fs-ui`. The footer and a label's own action take `--fs-caption`; fields take `--fs-field`.
143
144
  - One title per screen: `--fs-title` (`22px`), medium, `--tracking-snug` (`-0.01em`). No subtitles, taglines, or marketing lines; copy stays short.
144
145
  - Fields and buttons keep the standard 36px box: the filled field and a full-width default-size primary.
145
- - Labels are small, muted, and above the field.
146
+ - Labels are small, regular, muted, and above the field.
146
147
  - The primary button is full-width yellow. “Forgot password?” is the Password field's `.label-action`. Other secondary actions sit under the form in `.auth-links`: a bare link stays muted (“Use a recovery code”, “← Back to sign in”); a prompt's link (“New to put.io? Sign up”, “Wrong account? Sign out”) is `--text`, medium, and underlines only on hover. Two items split to the edges; a lone link or prompt centres.
147
148
  - Buttons outside a form sit in `.auth-actions`, 16px below what precedes them; a description `.auth-note` right before them leaves 28px. A back link leads with Phosphor's arrow-left as inline SVG. A legal line under the submit button centres on it.
148
149
  - Tab order runs fields (each followed by its label action), submit, then secondary links; DOM order follows visual order, with no positive `tabindex`. Two-factor runs the code, Verify, then its links. The reveal-password toggle takes `tabindex="-1"` and keeps its accessible name: keyboard-only users can't toggle visibility, screen-reader users still can in browse mode. No link leaves the tab order.
@@ -150,7 +151,7 @@ Default radius `6px`; `4px` for tight controls, `8px` or `10px` for panels, pill
150
151
  - Copy: “Sign in”, “Sign up”, and “That username or password doesn't look right.”
151
152
  - auth.put.io still ships the older card layout: drift.
152
153
  - References: `web-s06-auth`, `web-p00c-auth-signin`, `web-p00d-auth-signup`, `web-p00e-auth-2fa`. Outside references: the TIDAL, Stripe Link, Cursor, Linear, and Vercel sign-in pages.
153
- - One-time codes are one `.otp-input` (`inputmode="numeric"`, `autocomplete="one-time-code"`, `maxlength="6"`, `aria-invalid`) shown through two `.otp-group`s, one `.otp-separator`, and six `.otp-slot`s; script syncs slot text and `filled`/`active`, and maps a clicked slot to the input selection. The slots stretch the full column with mono digits. The label reads “Code from your authenticator app”, with no hint line.
154
+ - One-time codes are one `.otp-input` (`inputmode="numeric"`, `autocomplete="one-time-code"`, `maxlength="6"`, `aria-invalid`) inside an `.otp` root, shown through two `.otp-group`s, one `.otp-separator`, and six `.otp-slot`s; script syncs slot text and `filled`/`active`, and maps a clicked slot to the input selection. The slots stretch the full column with mono digits. The label reads “Code from your authenticator app”, with no hint line.
154
155
  - Editing an invalid code closes the error; retry waits for six digits. `data-state="verifying"` disables the input, keeps the digits, and announces through a polite live region. `data-state="success"` keeps the digits read-only, announces continuation in a `role="status"` region, and shows no further action; the consumer owns navigation. The submit turns a disabled `.btn-success` with `data-state="success"`, relabelled “Verified”, announced through a visually hidden status region.
155
156
  - “Use a recovery code” appears only once a consumer owns the route. Groups own the responsive width, so the control fits narrow columns without scrolling.
156
157
 
package/README.md CHANGED
@@ -47,28 +47,15 @@ keeps the token file's element styles below utilities:
47
47
  ```
48
48
 
49
49
  Utilities then read the tokens: `bg-bg` is `var(--bg)`, `rounded-sm` is
50
- `var(--radius-sm)`, `text-lg` is `var(--fs-lg)`. The full mapping:
50
+ `var(--radius-sm)`, `text-lg` is `var(--fs-lg)`. Theme rules:
51
51
  [Tailwind v4 theme](system/README.md#tailwind-v4-theme).
52
52
 
53
- Package entrypoints, from `exports` in [package.json](package.json):
54
-
55
- | Subpath | File |
56
- | -------------------------------- | ----------------------------------------------------------------------------------- |
57
- | `@putdotio/design/css` | [`dist/css/tokens.css`](dist/css/tokens.css) |
58
- | `@putdotio/design/components` | [`system/components.css`](system/components.css) |
59
- | `@putdotio/design/tailwind` | [`dist/css/tailwind.css`](dist/css/tailwind.css) |
60
- | `@putdotio/design/tokens` | [`dist/tokens.flat.json`](dist/tokens.flat.json) |
61
- | `@putdotio/design/tokens/meta` | [`dist/tokens.js`](dist/tokens.js), typed by [`dist/tokens.d.ts`](dist/tokens.d.ts) |
62
- | `@putdotio/design/tokens/dtcg` | [`dist/tokens.dtcg.json`](dist/tokens.dtcg.json) |
63
- | `@putdotio/design/tokens/figma` | [`dist/figma/putio.tokens.json`](dist/figma/putio.tokens.json) |
64
- | `@putdotio/design/assets/<file>` | [`system/assets`](system/assets) |
65
- | `@putdotio/design/design.md` | [`DESIGN.md`](DESIGN.md) |
53
+ Every entrypoint is listed under `exports` in [package.json](package.json).
66
54
 
67
55
  ## Docs
68
56
 
69
57
  - [Design contract](DESIGN.md)
70
- - [Design guide structure](system/README.md)
71
- - [Distribution](docs/distribution.md)
58
+ - [Design guide](system/README.md)
72
59
  - [Contributing](CONTRIBUTING.md)
73
60
  - [Security](https://github.com/putdotio/.github/blob/main/SECURITY.md)
74
61
  - [Agent guide](AGENTS.md)
@@ -521,6 +521,9 @@
521
521
  }
522
522
 
523
523
  /* -- Document base ------------------------------------------------- */
524
+ /* Native scrollbars, controls and autofill follow the mode. */
525
+ :root { color-scheme: light; }
526
+ .dark { color-scheme: dark; }
524
527
  html {
525
528
  background: var(--html-bg);
526
529
  color: var(--text);
@@ -555,7 +558,6 @@ body {
555
558
  .num, .tabular {
556
559
  font-family: var(--font-mono);
557
560
  font-variant-numeric: tabular-nums;
558
- font-feature-settings: "tnum";
559
561
  }
560
562
 
561
563
  h1, .h1 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putdotio/design",
3
- "version": "5.1.0",
3
+ "version": "5.2.1",
4
4
  "description": "Public put.io design tokens, brand assets, and design-system guidance.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -93,5 +93,5 @@
93
93
  "typescript": "^7.0.2",
94
94
  "yaml": "^2.9.0"
95
95
  },
96
- "packageManager": "pnpm@12.14.0"
96
+ "packageManager": "pnpm@12.15.0"
97
97
  }
package/system/README.md CHANGED
@@ -1,228 +1,76 @@
1
1
  # put.io design system
2
2
 
3
- The guide site: generated site tokens, component CSS, preview cards, and the
4
- design-system index.
3
+ The guide site and the package's component and Tailwind layers. The design
4
+ rules live in [DESIGN.md](../DESIGN.md).
5
5
 
6
- ## Layout
7
-
8
- - `index.html` redirects to `design-system.html`, the guide and preview-card
9
- index. `design-system-light.html` redirects to
10
- `design-system.html?theme=light`.
11
- - `tokens.css` is generated from `../tokens/**/*.tokens.json`; edit the token
12
- sources and rebuild.
13
- - `components.css` is the Tier-1 component layer (the web contract).
14
- - `tv.css` is the TV / 10-foot component CSS, scoped to `.tv` artboards.
15
- - `assets/` holds logos, favicons, retro marks, and app icons.
16
- - `preview/` holds specimen cards for the foundations and every platform tier.
17
- Its `_`-prefixed files are card chrome only (frame, tier strip, HIG, M3, and
18
- Roku shells, resize and password-toggle helpers).
19
-
20
- Cards are named `<platform>-<section><n>-<subject>.html` with section letter `f`
21
- foundations, `c` components, `e` elements, `p` patterns, or `s` screens
22
- (`ios-e01-toggle.html`); the numbered `00-…13-…` files are the tier-0
23
- foundations. Element cards are a fixed 1120×580 viewport: one control, its
24
- states, a spec strip, a don't block.
25
-
26
- ## Fonts
27
-
28
- Preview pages load the public put.io font CSS from `static.put.io`, the same
29
- source as the product; font licensing is in
30
- [Distribution](../docs/distribution.md#fonts-and-assets). Each preview links
31
- both families in `<head>`:
32
-
33
- ```html
34
- <link rel="stylesheet" href="https://static.put.io/fonts/gt-america/standard/font.css" />
35
- <link rel="stylesheet" href="https://static.put.io/fonts/berkeley-mono/variable/font.css" />
36
- ```
37
-
38
- Those two links are the full font set: mono text reads `--font-mono` (Berkeley
39
- Mono), whose tabular figures carry the numerics.
40
-
41
- Weight names on the font host:
42
- `100 ultra-light · 200 thin · 300 light · 400 regular · 500 medium · 700 bold · 900 black`.
43
- The tokens use four of them through `--fw-regular`, `--fw-medium`, `--fw-bold`,
44
- and `--fw-black`.
45
-
46
- ## Using tokens
47
-
48
- Guide pages in `system/` load the generated site stylesheet:
49
-
50
- ```html
51
- <link rel="stylesheet" href="./tokens.css" />
52
- ```
53
-
54
- The canonical source is DTCG-compatible JSON in [`../tokens`](../tokens). This
55
- site stylesheet (`system/tokens.css`) and the package stylesheet
56
- (`dist/css/tokens.css`, exported as `@putdotio/design/css`) are generated from
57
- the same source. Brand yellow is `var(--yellow-solid)`; its emitted hsl form is
58
- pinned in the [`../DESIGN.md`](../DESIGN.md) frontmatter, and the
59
- `--button-primary-bg-hover` derivation is in
60
- [Distribution](../docs/distribution.md#generated-files).
61
-
62
- Stacking, breakpoints, the root font-size, and the `@media` literal rule live
63
- in [Layout & Spacing](../DESIGN.md#layout--spacing) and
64
- [Typography](../DESIGN.md#typography).
65
-
66
- Package consumers import as in the [README](../README.md#use).
67
-
68
- For **TV preview cards**, also load `tv.css`, which adds the `.tv`, `.scr`,
69
- `.row`, solid surface tiers, and player chrome on top of the tokens, authored
70
- 1:1 at 1920×1080 (a px in the file is a px on the TV). Every component selector
71
- is scoped under `.tv`, so the file can be bundled globally alongside web
72
- components. Platform repos implement TV components in their native UI stacks:
73
-
74
- ```html
75
- <link rel="stylesheet" href="./tokens.css" /> <link rel="stylesheet" href="./tv.css" />
76
- ```
77
-
78
- TV material, focus, and the `tv` token group rules live in
79
- [Components](../DESIGN.md#components). Guide specifics: the `tv` group is
80
- `mode: "tv"` and read from `dist/tokens.flat.json`; `--radius-tv` is the one
81
- `tv` value the token CSS emits, so `tv.css` declares the `--tv-*` properties
82
- its cards use itself.
83
-
84
- ## Core rules
85
-
86
- - **Yellow** follows [Colors](../DESIGN.md#colors). Guide specifics: `--yellow-solid-hover` is the hover peer with one value in both modes, and button focus-visible rings use `--shadow-focus`: a 2px `--bg` gap, then a 2px `--solid-hover` ring, at least 3:1 against the page and panels. `--shadow-focus-color` (the yellow at 35% alpha) stays only as shadcn's `--ring`. Form fields focus with `--field-ring` instead.
87
- - **Yellow as text on light** uses `--yellow-text-secondary` (≈5:1, AA); `--yellow-solid` is fill-only on light backgrounds.
88
- - **Labels on yellow** use `--primary-foreground`, a warm dark that passes AA on the yellow fill.
89
- - **One design, two modes.** Light and dark are the same markup and components with different token values. Toggle `.dark` on `<html>`; one page serves both modes. Components consume semantic tokens (`--bg`, `--text`, `--border`, `--accent`, …) instead of raw `#hex` or `hsl()`.
90
- - **Text sizes are tokens.** The guide, the web previews, and their shared CSS (`_tier.css`, `_frame.css`, `_element.css`) set text with a role (`--fs-ui`, `--fs-body`, `--fs-caption`, `--fs-field`) or a heading step, per [Typography](../DESIGN.md#typography). Icon glyphs keep px, rules under `.tv` keep the TV grid, and native and TV previews keep platform px. `pnpm verify` fails on any other literal font size.
91
- - **Wordmarks are optically pre-centred.** All three logo SVGs carry built-in top padding in the viewBox (retro pair `0 -16 376 112`, `logo.svg` `0 -24.44 621.79 176.055`). Flex-centre them as-is, with no `translateY` nudge. Height-set placements size boxes at 7/6 of the ink height.
92
-
93
- Icons, fields and panels, and raw filenames follow the root
94
- [Components](../DESIGN.md#components) and
95
- [Content and Icons](../DESIGN.md#content-and-icons).
96
-
97
- ## Binding tiers
6
+ ## Preview cards
98
7
 
99
- Tier definitions, the Component/Element distinction, and the `preview/_tier.css`
100
- pairing rule live in [Binding Tiers](../DESIGN.md#binding-tiers). An Element
101
- card shows how a stock control receives tokens.
8
+ `design-system.html` indexes every card. Each card renders one concept against
9
+ the real tokens; read it as a spec.
102
10
 
103
- Native cards are drawn 1:1 in their own unit (iPhone 393×852pt, iPad
104
- 1024×768pt, Apple Watch 176×215pt, Android 412×915dp, TV 1920×1080px), so a
105
- number written on a card is the number in the HIG or the Material spec. Those
106
- metrics are Apple's and Google's and stay out of the put.io token graph. Device
107
- bezels and on-video chrome stay untokenised.
11
+ - Name cards `<platform>-<section><n>-<subject>.html`, with section `f`
12
+ foundations, `c` components, `e` elements, `p` patterns, or `s` screens
13
+ (`ios-e01-toggle.html`). The numbered `00-…13-…` files are tier-0
14
+ foundations. `pnpm verify` rejects other names.
15
+ - Element cards are a fixed 1120×580 viewport: one control, its states, a spec
16
+ strip, a don't block.
17
+ - Native cards are drawn 1:1 in their own unit (iPhone 393×852pt, iPad
18
+ 1024×768pt, Apple Watch 176×215pt, Android 412×915dp, TV 1920×1080px), so a
19
+ number on a card is the number in the HIG or the Material spec. Those
20
+ metrics, device bezels, and on-video chrome stay out of the token graph.
21
+ - Each card links the public font CSS from `static.put.io`; these two links are
22
+ the full font set:
23
+
24
+ ```html
25
+ <link rel="stylesheet" href="https://static.put.io/fonts/gt-america/standard/font.css" />
26
+ <link rel="stylesheet" href="https://static.put.io/fonts/berkeley-mono/variable/font.css" />
27
+ ```
28
+
29
+ - TV cards also load `tv.css`, authored 1:1 at 1920×1080 and scoped under
30
+ `.tv`. It declares the `--tv-*` properties its cards use, because the token
31
+ CSS emits only `--radius-tv` from the `tv` group.
32
+ - Wordmark SVGs carry their optical centring in the viewBox. Flex-centre them
33
+ as is, with no `translateY` nudge.
108
34
 
109
35
  ## Theme System
110
36
 
111
- The guide (`design-system.html`) owns the theme toggle. It writes
112
- `putio-ds-theme` to `localStorage`, updates `html.dark`, and broadcasts
113
- `{type:'__theme', theme}` to every embedded preview iframe via `postMessage`,
114
- so embeds flip live without reloading. Each preview's inline bootstrap reads
115
- the same storage key on standalone open, and `preview/_resize.js` listens for
116
- the parent broadcast when embedded. A URL query (`?theme=light` or
117
- `?theme=dark`) overrides both, for screenshots.
37
+ Light and dark are the same markup with different token values: toggle `.dark`
38
+ on `<html>`. The guide stores the choice in `localStorage` and broadcasts it to
39
+ embedded cards; `?theme=light` or `?theme=dark` overrides both, for
40
+ screenshots.
118
41
 
119
- Fixed-mode previews opt out with `<html data-theme-lock="dark">`, reserved for
120
- product mockups whose visual language is intrinsically one mode. A 10-foot
121
- screen, a native app mockup, and on-video player chrome are fixed-mode
122
- surfaces, so the `ios-*`, `android-*`, `androidtv-*`, `tvos-*`, `watchos-*`,
123
- `roku-*`, `tv-*`, and `mobile-*` cards plus `web-p06-player.html` are locked.
124
- Locked previews ignore `localStorage`, parent broadcasts, and the URL query.
125
- New component previews stay unlocked, so the tokens render them in both modes.
42
+ Native, TV, and on-video player cards are fixed-mode product mockups and set
43
+ `<html data-theme-lock="dark">`, which ignores the toggle and the query. Every
44
+ other card stays unlocked, and the e2e suite checks it in both modes.
126
45
 
127
46
  ## shadcn / Base UI interop
128
47
 
129
- The token layer aliases the canonical shadcn token names, so shadcn/ui blocks,
130
- Base UI components, and Tailwind presets resolve against put.io values without
131
- renaming. Each shadcn name aliases a put.io token and carries no value of its
132
- own, so the two name systems cannot drift.
133
-
134
- | shadcn name | put.io target |
135
- | -------------------------------------------- | ---------------------------------------------------------- |
136
- | `--primary` / `--primary-foreground` | `--yellow-solid` / `var(--primary-foreground)` (warm dark) |
137
- | `--destructive` / `--destructive-foreground` | `--red-solid` / `var(--destructive-foreground)` (= `#fff`) |
138
- | `--success` / `--success-foreground` | `--green-solid` / `var(--success-foreground)` (= `#fff`) |
139
- | `--muted` / `--muted-foreground` | `--bg-secondary` / `--text-secondary` |
140
- | `--accent` / `--accent-foreground` | `--component-bg` / `--text` |
141
- | `--card` / `--card-foreground` | `--component-bg` / `--text` |
142
- | `--popover` / `--popover-foreground` | `--component-bg` / `--text` |
143
- | `--input` | `--field-border` |
144
- | `--ring` | `--shadow-focus-color` |
145
- | `--background` / `--foreground` | `--bg` / `--text` |
146
-
147
- The `--input-*` set (`-bg`, `-border`, `-border-hover`, `-border-focus`,
148
- `-ring`, `-text`, `-placeholder`, `-radius`) and `--foreground-muted` are
149
- [deprecated](../docs/distribution.md#deprecated-tokens): shadcn itself names
150
- only `--input` and `--muted-foreground`. Each deprecated name aliases its
151
- replacement; **author against `--field-*` and `--text-secondary`.**
48
+ The token layer defines the shadcn names (`--primary`, `--muted-foreground`,
49
+ `--input`, `--ring`, …) as aliases of put.io tokens, so shadcn/ui blocks and
50
+ Base UI components resolve against put.io values without renaming.
152
51
 
153
- On a solid surface, read the foreground tokens (`--primary-foreground`,
154
- `--destructive-foreground`, `--success-foreground`), which encode the mode-safe
155
- inverse pair, instead of writing literal `#000` / `#fff`.
156
-
157
- put.io components use the long descriptive names (`--component-bg-hover`,
158
- `--yellow-text-secondary`) because they name the role exactly; shadcn-imported
159
- code keeps the short names.
52
+ - Author against `--field-*` and `--text-secondary`. The `--input-*` set and
53
+ `--foreground-muted` are deprecated aliases.
54
+ - On a solid fill, read `--primary-foreground`, `--destructive-foreground`, or
55
+ `--success-foreground` instead of literal `#000` or `#fff`.
56
+ - Express state with `data-state` (`open`, `checked`, `completed`, …), the
57
+ attribute headless primitives set, not class flags such as `.is-active`.
58
+ - Mark compound parts with `data-slot` (`modal-header`, `card-title`, …) so
59
+ external CSS can target one part without nested class chains.
160
60
 
161
61
  ### Tailwind v4 theme
162
62
 
163
63
  `@putdotio/design/tailwind` ([`dist/css/tailwind.css`](../dist/css/tailwind.css))
164
- maps the tokens into Tailwind v4 theme keys. The build derives each key from the
165
- token's type and CSS name, so new tokens join their namespace without a hand
166
- list. Import it after `tailwindcss` and `@putdotio/design/css`; the
167
- [README](../README.md#use) shows the import lines.
168
-
169
- | Tailwind key | put.io token | Example utilities |
170
- | ------------------------- | ---------------------------------------------------------- | ----------------------------------------------- |
171
- | `--color-<name>` | every color token `--<name>` | `bg-bg`, `text-muted-foreground` |
172
- | `--font-*` | `--font-*` | `font-sans`, `font-mono` |
173
- | `--font-weight-*` | `--fw-*` | `font-regular`, `font-bold` |
174
- | `--text-*` | `--fs-*` | `text-sm`, `text-display` |
175
- | `--leading-*` | `--lh-*` | `leading-tight` |
176
- | `--tracking-*` | `--tracking-*`, `--button-tracking*` | `tracking-tight`, `tracking-button` |
177
- | `--radius`, `--radius-*` | `--radius`, `--radius-*`, `--<component>-radius` | `rounded`, `rounded-sm`, `rounded-panel` |
178
- | `--shadow-*` | `--shadow-*`, `--<component>-shadow`, `--<component>-ring` | `shadow-sm`, `shadow-menu`, `shadow-field-ring` |
179
- | `--ease-*` | `--ease-*` | `ease-out` |
180
- | `--transition-duration-*` | `--dur-*` | `duration-base` |
181
-
182
- - The block is `@theme inline reference`. Utilities read the put.io custom
183
- property where they apply, so `.dark` works. Tailwind declares none of the
184
- keys, so `--radius-sm` or `--font-sans` stays the token instead of a
185
- self-reference. In custom CSS, read the put.io name (`var(--bg)`), not
186
- `var(--color-bg)`.
187
- - shadcn class names such as `bg-primary`, `border-input`, and
188
- `text-muted-foreground` resolve through the aliases above.
189
- - `text-*` sizes set no line height; the document's `--lh-normal` applies until
190
- a `leading-*` utility sets one.
191
- - TV tokens, z-indexes and breakpoints stay out. Deprecated tokens stay in until a major release removes them.
192
- - `--spacing` is `var(--space-1)`, so `p-4` is 16px at any root size and equals
193
- `--space-4`. Tailwind defaults that put.io does not define, such as
194
- `rounded-xl`, stay available.
195
-
196
- ### State via `data-state`, not class flags
197
-
198
- Base UI / headless primitives set
199
- `data-state="open|closed|checked|unchecked|active|completed|pending|loading"`
200
- on the DOM. put.io components target those same attribute values in CSS; see
201
- the wizard step bar in `web-p00b-form-flows.html`
202
- (`.step[data-state="completed"]`) and the menu/table cards. Express state with
203
- `data-state` rather than class flags (`.is-active`, `.on`, `.current`), so the
204
- same DOM contract works with any controlling code and devtools show the state
205
- directly.
206
-
207
- ### Compound parts via `data-slot`
208
-
209
- shadcn marks parts of compound components with `data-slot="card-header"`,
210
- `data-slot="card-title"`, and so on. put.io does the same on the folder picker
211
- (`data-slot="modal" / "modal-header" / "modal-body" / "modal-footer"`), so
212
- external CSS can target one part without nested class chains.
213
-
214
- ## Design variants
215
-
216
- Four documented type stacks; pick one per surface:
217
-
218
- | Variant | Stack | Use when |
219
- | ------------ | -------------------------------------------------- | ------------------------------------ |
220
- | Clean Modern | GT America | default app UI |
221
- | Monospace | Berkeley Mono | terminal, logs, technical dashboards |
222
- | Brutalist | GT America Black + Berkeley Mono | marketing punctuation |
223
- | Editorial | GT America Black 900 (tight tracking) + GT America | landing hero, about |
224
-
225
- ## Preview cards
226
-
227
- `design-system.html` is the full index. Each card renders one concept against
228
- the real tokens; read it as a spec.
64
+ maps the tokens into Tailwind v4 theme keys: `bg-bg`, `rounded-panel`,
65
+ `text-display`, `duration-base`. Import it after `tailwindcss` and
66
+ `@putdotio/design/css`, as in the [README](../README.md#use).
67
+
68
+ - The block is `@theme inline reference`: utilities read the put.io custom
69
+ property, so `.dark` works. In custom CSS, read the put.io name (`var(--bg)`),
70
+ not `var(--color-bg)`.
71
+ - `text-*` sizes set no line height; `--lh-normal` applies until a `leading-*`
72
+ utility sets one.
73
+ - `--spacing` is `var(--space-1)`, so `p-4` is 16px and equals `--space-4`.
74
+ - z-indexes, breakpoints, and the `tv` group except `--radius-tv` stay out.
75
+ Tailwind defaults that put.io does not define, such as `rounded-xl`, stay
76
+ available.
@@ -0,0 +1,9 @@
1
+ <!--
2
+ 108dp adaptive-icon grid, at the colour icon's scale (its 1024 master fills
3
+ the 72dp centre). Paths carry no fill: the platform tints them.
4
+ -->
5
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 108 108">
6
+ <path fill-rule="evenodd" d="M34.594 44.508H35.651V40.289H36.709V38.18H37.766V37.125H38.823V36.07H39.881V33.961H41.996V32.906H43.053V31.852H45.168V30.797H47.283V29.742L58.915 29.742V30.797H61.029V31.852H63.144V32.906H65.259V33.961H66.316V35.016H67.374V36.07H68.431V38.18H69.489V40.289H70.546V42.398H71.604V52.945H70.546V56.109H69.489V58.219H68.431V59.273H67.374V60.328H66.316V61.383H65.259V62.438H64.202V63.492H62.087V64.547H59.972V65.602H55.742V66.656H45.168V67.711H44.111V72.984H43.053V74.039H41.996V75.094H36.709V74.039H35.651V72.984H34.594L34.594 44.508ZM46.225 44.508V42.398H47.283V41.344H49.397V40.289H51.512V39.234H54.685V40.289H57.857V41.344H58.914V42.398H59.972V44.508H61.029V50.836H59.972V51.891H58.914V52.945H57.857V54H56.8V55.055H49.397V54H48.34V52.945H47.283V51.891H46.225V49.781H45.168V44.508H46.225Z"/>
7
+ <path d="M50.455 43.453H48.34V45.562H47.283V48.727H48.34V50.836H49.398V48.727H50.455V46.617H51.513V45.562H53.627V44.508H55.742V43.453H56.8V42.398H53.627V41.344H52.57V42.398H50.455V43.453Z"/>
8
+ <path d="M74.776 44.508H73.719V54H72.662V57.164H71.604V59.273H70.546V60.328H69.489V61.383H68.432V62.438H67.374V63.492H66.317V64.547H65.259V65.602H63.145V66.656H61.03V67.711H56.8V68.766H46.226L46.226 74.039H45.168V75.094H44.111V76.148H43.053V77.203H39.881V78.258H40.939V79.312H46.226V78.258H47.283V77.203H48.341V71.93H49.398V70.875H59.972V69.82H64.202V68.766H66.317V67.711H68.432V66.656H69.489V65.602H70.546V64.547H71.604V63.492H72.662V62.438H73.719V60.328H74.776V57.164H75.834V46.617H74.776V44.508Z"/>
9
+ </svg>
@@ -79,6 +79,7 @@ button i { font-size: var(--button-icon-size); line-height: 1; display: inline-f
79
79
  .btn-icon { width: calc(var(--button-height) * var(--tw-fs, 1)) !important; padding: 0 !important; text-transform: none; letter-spacing: normal; }
80
80
  .btn-icon.btn-md { width: calc(var(--button-height-md) * var(--tw-fs, 1)) !important; }
81
81
  .btn-icon.btn-sm { width: calc(var(--button-height-sm) * var(--tw-fs, 1)) !important; }
82
+ .btn-icon.btn-xs { width: calc(var(--button-height-xs) * var(--tw-fs, 1)) !important; }
82
83
 
83
84
  /* Layout-only modifier — full-width CTA */
84
85
  .btn-block { width: 100%; }
@@ -98,18 +99,17 @@ button i { font-size: var(--button-icon-size); line-height: 1; display: inline-f
98
99
  .btn-quiet.btn-danger, .btn-quiet.btn-info, .btn-quiet.btn-default {
99
100
  background: transparent; border-color: transparent; color: var(--button-ghost-fg);
100
101
  }
101
- .btn-quiet:hover:not(:disabled), .btn-quiet.btn-default:hover:not(:disabled) { background: var(--button-ghost-bg-hover); border-color: transparent; color: var(--button-ghost-fg-hover); }
102
+ /* The hover fill and focus ring round off; an icon-only quiet button takes the square box. */
103
+ .btn-quiet { border-radius: var(--button-radius); }
104
+ .btn-quiet.btn-icon { height: calc(var(--button-height) * var(--tw-fs, 1)); }
102
105
  .btn-quiet.btn-info { color: var(--text); }
103
106
  /* --yellow-text-secondary, not --yellow-solid: solid is a fill step, and in
104
107
  light mode the brand yellow as a glyph colour on a light surface is
105
108
  unreadable. The text step carries a legible value in both modes. */
106
109
  .btn-quiet.btn-primary, .btn-quiet.btn-warning { color: var(--yellow-text-secondary); }
107
- .btn-quiet.btn-primary:hover:not(:disabled), .btn-quiet.btn-warning:hover:not(:disabled) { background: var(--yellow-component-bg-hover); border-color: transparent; color: var(--yellow-text-secondary); }
108
110
  .btn-quiet.btn-success { color: var(--green-solid); }
109
- .btn-quiet.btn-success:hover:not(:disabled) { background: var(--green-component-bg-hover); border-color: transparent; color: var(--green-solid); }
110
111
  .btn-quiet.btn-danger { color: var(--red-solid); }
111
- .btn-quiet.btn-danger:hover:not(:disabled) { background: var(--red-component-bg-hover); border-color: transparent; color: var(--red-solid); }
112
- .btn-quiet:disabled { opacity: 1; color: var(--solid); background: transparent; }
112
+ .btn-quiet:is(:disabled, [aria-disabled="true"]) { opacity: 1; color: var(--solid); background: transparent; }
113
113
 
114
114
  /* Variants — token-driven. Foregrounds read from --*-foreground
115
115
  tokens in tokens.css so "what color on top" lives in one place.
@@ -121,17 +121,11 @@ button i { font-size: var(--button-icon-size); line-height: 1; display: inline-f
121
121
  accidental low-contrast bug. Never use these variants at xs/sm — the
122
122
  label drops below the large-text threshold. */
123
123
  .btn-primary { background: var(--button-primary-bg); border-color: var(--button-primary-bg); color: var(--button-primary-fg); }
124
- .btn-primary:hover:not(:disabled) { background: var(--button-primary-bg-hover); border-color: var(--button-primary-bg-hover); }
125
124
  .btn-success { background: var(--button-success-bg); border-color: var(--button-success-bg); color: var(--button-success-fg); }
126
- .btn-success:hover:not(:disabled) { background: var(--button-success-bg-hover); border-color: var(--button-success-bg-hover); }
127
125
  .btn-danger { background: var(--button-danger-bg); border-color: var(--button-danger-bg); color: var(--button-danger-fg); }
128
- .btn-danger:hover:not(:disabled) { background: var(--button-danger-bg-hover); border-color: var(--button-danger-bg-hover); }
129
126
  .btn-info { background: var(--button-info-bg); border-color: var(--button-info-bg); color: var(--button-info-fg); }
130
- .btn-info:hover:not(:disabled) { background: var(--button-info-bg-hover); border-color: var(--button-info-bg-hover); }
131
127
  .btn-invert { background: var(--text); border-color: var(--border); color: var(--invert-foreground); }
132
- .btn-invert:hover:not(:disabled) { border-color: var(--border-hover); }
133
128
  .btn-default { background: var(--button-default-bg); border-color: var(--border); color: var(--button-default-fg); }
134
- .btn-default:hover:not(:disabled) { background: var(--button-default-bg-hover); border-color: var(--border-hover); }
135
129
 
136
130
  /* Ghost — the third tier: text-only. No fill, no border at rest;
137
131
  hover paints the shared quiet fill and lifts the label a step
@@ -143,36 +137,55 @@ button i { font-size: var(--button-icon-size); line-height: 1; display: inline-f
143
137
  Disabled matches the quiet treatment: the colour drops to --solid,
144
138
  the box does not fade. */
145
139
  .btn-ghost { background: var(--button-ghost-bg); border-color: transparent; color: var(--button-ghost-fg); }
146
- .btn-ghost:hover:not(:disabled) { background: var(--button-ghost-bg-hover); border-color: transparent; color: var(--button-ghost-fg-hover); }
147
- .btn-ghost:disabled { opacity: 1; color: var(--solid); background: transparent; }
140
+ .btn-ghost:is(:disabled, [aria-disabled="true"]) { opacity: 1; color: var(--solid); background: transparent; }
141
+
142
+ /* Hover — pointer devices only, so a tapped button doesn't stay lit on touch.
143
+ Quiet comes after the filled variants, so a quiet info button keeps the
144
+ ghost hover. */
145
+ @media (hover: hover) and (pointer: fine) {
146
+ .btn-primary:hover:not(:disabled, [aria-disabled="true"]) { background: var(--button-primary-bg-hover); border-color: var(--button-primary-bg-hover); }
147
+ .btn-success:hover:not(:disabled, [aria-disabled="true"]) { background: var(--button-success-bg-hover); border-color: var(--button-success-bg-hover); }
148
+ .btn-danger:hover:not(:disabled, [aria-disabled="true"]) { background: var(--button-danger-bg-hover); border-color: var(--button-danger-bg-hover); }
149
+ .btn-info:hover:not(:disabled, [aria-disabled="true"]) { background: var(--button-info-bg-hover); border-color: var(--button-info-bg-hover); }
150
+ .btn-invert:hover:not(:disabled, [aria-disabled="true"]) { border-color: var(--border-hover); }
151
+ .btn-default:hover:not(:disabled, [aria-disabled="true"]) { background: var(--button-default-bg-hover); border-color: var(--border-hover); }
152
+ .btn-ghost:hover:not(:disabled, [aria-disabled="true"]) { background: var(--button-ghost-bg-hover); border-color: transparent; color: var(--button-ghost-fg-hover); }
153
+ .btn-quiet:hover:not(:disabled, [aria-disabled="true"]) { background: var(--button-ghost-bg-hover); border-color: transparent; color: var(--button-ghost-fg-hover); }
154
+ .btn-quiet.btn-primary:hover:not(:disabled, [aria-disabled="true"]), .btn-quiet.btn-warning:hover:not(:disabled, [aria-disabled="true"]) { background: var(--yellow-component-bg-hover); border-color: transparent; color: var(--yellow-text-secondary); }
155
+ .btn-quiet.btn-success:hover:not(:disabled, [aria-disabled="true"]) { background: var(--green-component-bg-hover); border-color: transparent; color: var(--green-solid); }
156
+ .btn-quiet.btn-danger:hover:not(:disabled, [aria-disabled="true"]) { background: var(--red-component-bg-hover); border-color: transparent; color: var(--red-solid); }
157
+ }
148
158
 
149
159
  /* States */
150
- /* Bare disabled buttons fade; hover styles above are gated on :not(:disabled).
160
+ /* Bare disabled buttons fade. `aria-disabled="true"` counts as disabled, as
161
+ Base UI sets it on focusable disabled buttons; hover skips both.
151
162
  Submit buttons are never disabled at rest: the submit validates. A filled
152
163
  button is disabled only while its action runs (with a spinner) or once it
153
164
  is done, so it keeps its own fill and label at full opacity: "Verifying…"
154
165
  stays yellow, a finished 2FA "Verified" stays green with
155
166
  data-state="success". */
156
- button:disabled { opacity: 0.3; cursor: not-allowed; }
157
- :is(.btn-primary, .btn-success, .btn-danger, .btn-info, .btn-invert):not(.btn-quiet):disabled { opacity: 1; }
158
- .btn-default:not(.btn-quiet):disabled { opacity: 1; color: var(--solid); }
159
- /* An opaque double ring: a --bg gap, then --solid-hover, ≥3:1 on page and panels. */
160
- button:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
167
+ button:is(:disabled, [aria-disabled="true"]) { opacity: 0.3; cursor: not-allowed; }
168
+ :is(.btn-primary, .btn-success, .btn-danger, .btn-info, .btn-invert):not(.btn-quiet):is(:disabled, [aria-disabled="true"]) { opacity: 1; }
169
+ .btn-default:not(.btn-quiet):is(:disabled, [aria-disabled="true"]) { opacity: 1; color: var(--solid); }
170
+ /* An opaque double ring: a --bg gap, then --solid-hover, ≥3:1 on page and panels.
171
+ Forced-colors mode drops box-shadow and paints the transparent outline. */
172
+ button:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--shadow-focus); }
161
173
 
162
174
  /* Loading state — hides label, paints a CSS spinner over the button */
163
- button.is-loading { color: transparent !important; position: relative; pointer-events: none; opacity: 0.75; }
175
+ button.is-loading { color: transparent !important; position: relative; pointer-events: none; }
164
176
  button.is-loading::after {
165
177
  content: ''; position: absolute; inset: 0; margin: auto;
166
178
  width: 14px; height: 14px; border-radius: 50%;
167
179
  border: 1.5px solid currentColor; border-top-color: transparent;
180
+ color: var(--text);
168
181
  opacity: 0.75;
169
182
  animation: spin 0.7s linear infinite;
170
183
  }
171
184
  .btn-primary.is-loading::after { color: var(--primary-foreground); }
172
- .btn-success.is-loading::after,
173
- .btn-danger.is-loading::after,
174
- .btn-info.is-loading::after,
175
- .btn-invert.is-loading::after { color: var(--destructive-foreground); }
185
+ .btn-success.is-loading::after { color: var(--button-success-fg); }
186
+ .btn-danger.is-loading::after { color: var(--button-danger-fg); }
187
+ .btn-info.is-loading::after { color: var(--button-info-fg); }
188
+ .btn-invert.is-loading::after { color: var(--invert-foreground); }
176
189
  .btn-default.is-loading::after, .btn-ghost.is-loading::after { color: var(--text); }
177
190
  /* The spinner borrows currentColor, and .is-loading makes the label colour
178
191
  transparent — so a quiet button needs its own spinner colour or the control
@@ -186,14 +199,14 @@ button.is-loading::after {
186
199
  cards. Defined once here; do not redeclare it per card. */
187
200
  @keyframes spin { to { transform: rotate(360deg); } }
188
201
 
189
- /* Inputs/textareas/selects inherit nothing from the button reset.
190
- These are dropped for safety in case they ever do. */
202
+ /* Typed text never takes a label's tracking or case. Tailwind v4 preflight
203
+ sets letter-spacing: inherit on form controls, so reset both here. */
191
204
  input, textarea, select { text-transform: none; letter-spacing: normal; }
192
205
 
193
206
 
194
207
  /* ===========================================================
195
208
  Specimen header — the yellow-mono index marker that anchors
196
- each preview card. 11 files used to duplicate this verbatim.
209
+ each preview card.
197
210
  =========================================================== */
198
211
  .head {
199
212
  display: flex; align-items: baseline; gap: 16px;
@@ -221,13 +234,11 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
221
234
  pages take neither: see .auth-page.
222
235
 
223
236
  .panel = quiet inline reference container. Sits ON --bg,
224
- uses --bg-secondary so it stays recessive but
225
- still bordered. Code blocks, info asides, sidebar
226
- panels, callouts. Lower visual weight than a card.
237
+ reads --panel-* so consumers can retheme it apart
238
+ from cards; today the values match. Code blocks,
239
+ info asides, sidebar panels, callouts.
227
240
 
228
- Both use the same hairline border + 8–10 px radius — the
229
- ONLY thing that differs is the surface fill. Pick the role,
230
- not the chrome.
241
+ Pick the role, not the chrome.
231
242
  =========================================================== */
232
243
  .card {
233
244
  background: var(--component-bg);
@@ -252,10 +263,8 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
252
263
  /* ===========================================================
253
264
  Field primitives — production parity with app.put.io forms.
254
265
 
255
- ONE source of truth for input chrome. Local preview files used
256
- to redefine `.field` three times with different focus rings;
257
- now they all inherit from here. To override per-screen, change
258
- geometry (height/padding) — not the surface tokens.
266
+ ONE source of truth for input chrome. To override per-screen,
267
+ change geometry (height/padding) — not the surface tokens.
259
268
 
260
269
  Surface contract (filled, so a field reads on any surface):
261
270
  bg → --field-bg (= --bg-secondary)
@@ -290,10 +299,12 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
290
299
  background var(--dur-fast) var(--ease-out);
291
300
  }
292
301
  .field::placeholder { color: var(--field-placeholder); }
293
- .field:hover { border-color: var(--field-border-hover); }
302
+ @media (hover: hover) and (pointer: fine) {
303
+ .field:hover:where(:not(:disabled, [aria-disabled="true"])) { border-color: var(--field-border-hover); }
304
+ }
294
305
  .field:focus,
295
306
  .field:focus-visible {
296
- outline: none;
307
+ outline: 2px solid transparent;
297
308
  border-color: var(--field-border-focus);
298
309
  box-shadow: var(--field-ring);
299
310
  }
@@ -312,8 +323,8 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
312
323
  border-color: var(--red-border);
313
324
  transition-duration: var(--dur-reveal);
314
325
  }
315
- .field[aria-invalid="true"]:hover {
316
- border-color: var(--red-border-hover);
326
+ @media (hover: hover) and (pointer: fine) {
327
+ .field[aria-invalid="true"]:hover { border-color: var(--red-border-hover); }
317
328
  }
318
329
  .field[aria-invalid="true"]:focus,
319
330
  .field[aria-invalid="true"]:focus-visible {
@@ -381,8 +392,10 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
381
392
  text-decoration: none;
382
393
  white-space: nowrap;
383
394
  }
384
- .form-group > .label-action:hover,
385
- .form-group .label-row a:hover { color: var(--text); }
395
+ @media (hover: hover) and (pointer: fine) {
396
+ .form-group > .label-action:hover,
397
+ .form-group .label-row a:hover { color: var(--text); }
398
+ }
386
399
 
387
400
  /* ===========================================================
388
401
  Form feedback — one public recipe for block and inline status.
@@ -406,6 +419,7 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
406
419
  color: var(--alert-info-body);
407
420
  font-size: var(--fs-ui);
408
421
  line-height: var(--lh-normal);
422
+ overflow-wrap: anywhere;
409
423
  }
410
424
  .form-callout[hidden] { display: none; }
411
425
  .form-callout > :is(i, svg) {
@@ -484,6 +498,7 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
484
498
  gap: clamp(4px, 2vw, 8px);
485
499
  width: 100%;
486
500
  min-width: 0;
501
+ isolation: isolate;
487
502
  }
488
503
  .otp-input {
489
504
  position: absolute;
@@ -495,6 +510,7 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
495
510
  margin: 0;
496
511
  padding: 0;
497
512
  border: 0;
513
+ font-size: var(--fs-field);
498
514
  opacity: 0;
499
515
  cursor: text;
500
516
  }
@@ -531,6 +547,9 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
531
547
  border-color: var(--field-border-focus);
532
548
  box-shadow: var(--field-ring);
533
549
  }
550
+ @media (forced-colors: active) {
551
+ .otp:focus-within .otp-slot[data-state="active"] { outline: 2px solid Highlight; }
552
+ }
534
553
  .otp-separator {
535
554
  flex: 0 0 auto;
536
555
  padding: 0;
@@ -617,7 +636,7 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
617
636
  .auth-title {
618
637
  margin: 0 0 28px;
619
638
  font-size: var(--fs-title);
620
- line-height: 30px;
639
+ line-height: calc(30 / 22);
621
640
  font-weight: var(--fw-medium);
622
641
  letter-spacing: var(--tracking-snug);
623
642
  color: var(--text);
@@ -667,9 +686,11 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
667
686
  text-decoration: none;
668
687
  text-underline-offset: 3px;
669
688
  }
670
- .auth-links a:hover { text-decoration: underline; }
671
689
  .auth-links > a { color: var(--text-secondary); font-weight: inherit; }
672
- .auth-links > a:hover { color: var(--text); text-decoration: none; }
690
+ @media (hover: hover) and (pointer: fine) {
691
+ .auth-links a:hover { text-decoration: underline; }
692
+ .auth-links > a:hover { color: var(--text); text-decoration: none; }
693
+ }
673
694
  /* Two items split to the edges; a lone link or prompt centres. */
674
695
  .auth-links > :only-child { margin-inline: auto; text-align: center; }
675
696
  /* A back link leads with Phosphor's arrow-left, an inline SVG (or the icon font). */
@@ -685,7 +706,17 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
685
706
  font-size: var(--fs-caption);
686
707
  }
687
708
  .auth-footer a { color: var(--text-secondary); text-decoration: none; }
688
- .auth-footer a:hover { color: var(--text); }
709
+ @media (hover: hover) and (pointer: fine) {
710
+ .auth-footer a:hover { color: var(--text); }
711
+ }
712
+ .form-group > .label-action:focus-visible,
713
+ .form-group .label-row a:focus-visible,
714
+ .auth-links a:focus-visible,
715
+ .auth-footer a:focus-visible {
716
+ outline: 2px solid var(--solid-hover);
717
+ outline-offset: 2px;
718
+ border-radius: var(--radius-sm);
719
+ }
689
720
  /* A middot centres in the gap before each link after the first. The empty
690
721
  alt keeps it out of the link's accessible name. */
691
722
  .auth-footer > * + * { position: relative; }
@@ -742,25 +773,35 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
742
773
  `.on` is exactly the invented flag the state contract tells
743
774
  you not to add — prefer the attribute in new markup.
744
775
 
745
- .checkbox — div or <span>, data-state="checked" when on
776
+ .checkbox — <button role="checkbox">, aria-checked or data-state="checked"
746
777
  input[type="checkbox"] — native inputs get the brand accent
747
- .switch — div, data-state="checked" when on
778
+ .switch — <button role="switch">, aria-checked or data-state="checked".
779
+ Resize it with --switch-width and --switch-height; the thumb
780
+ and its travel follow.
748
781
  =========================================================== */
749
782
  .checkbox {
783
+ position: relative;
784
+ /* Buttons default to border-box; a span and a button draw the same box. */
785
+ box-sizing: content-box;
750
786
  width: 14px; height: 14px; flex-shrink: 0;
751
- border: 1.5px solid var(--border-hover);
787
+ padding: 0;
788
+ border: 1.5px solid var(--solid);
752
789
  border-radius: var(--radius-sm);
753
790
  background: transparent;
791
+ cursor: pointer;
754
792
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
755
793
  }
794
+ /* Pads the 14px box out to the 24px minimum target (WCAG 2.5.8). */
795
+ .checkbox::before { content: ''; position: absolute; inset: -5px; }
756
796
  .checkbox.checked,
757
- .checkbox[data-state="checked"] {
797
+ .checkbox[data-state="checked"],
798
+ .checkbox[aria-checked="true"] {
758
799
  background: var(--yellow-solid);
759
800
  border-color: var(--yellow-solid);
760
- position: relative;
761
801
  }
762
802
  .checkbox.checked::after,
763
- .checkbox[data-state="checked"]::after {
803
+ .checkbox[data-state="checked"]::after,
804
+ .checkbox[aria-checked="true"]::after {
764
805
  content: ''; position: absolute; left: 3px; top: 0;
765
806
  width: 5px; height: 9px;
766
807
  border: solid var(--primary-foreground); border-width: 0 2px 2px 0;
@@ -769,7 +810,9 @@ input, textarea, select { text-transform: none; letter-spacing: normal; }
769
810
  input[type="checkbox"], input[type="radio"] { accent-color: var(--yellow-solid); cursor: pointer; }
770
811
 
771
812
  .switch {
772
- width: 44px; height: 24px; flex-shrink: 0;
813
+ width: var(--switch-width, 44px); height: var(--switch-height, 24px); flex-shrink: 0;
814
+ padding: 0;
815
+ border: 0;
773
816
  border-radius: var(--radius-pill);
774
817
  background: var(--component-bg-active);
775
818
  position: relative; cursor: pointer;
@@ -777,13 +820,17 @@ input[type="checkbox"], input[type="radio"] { accent-color: var(--yellow-solid);
777
820
  }
778
821
  .switch::after {
779
822
  content: ''; position: absolute; top: 2px; left: 2px;
780
- width: 20px; height: 20px; border-radius: 50%;
823
+ width: calc(var(--switch-height, 24px) - 4px); height: calc(var(--switch-height, 24px) - 4px); border-radius: 50%;
781
824
  background: var(--text);
782
- transition: left var(--dur-fast) var(--ease-out);
825
+ transition: transform var(--dur-fast) var(--ease-out);
783
826
  }
784
827
  .switch.on,
785
- .switch[data-state="checked"] { background: var(--green-solid); }
828
+ .switch[data-state="checked"],
829
+ .switch[aria-checked="true"] { background: var(--green-solid); }
786
830
  /* The thumb rides the green selected track, so it takes the token for "what
787
831
  colour sits on green" rather than a raw white that no theme can reach. */
788
832
  .switch.on::after,
789
- .switch[data-state="checked"]::after { left: 22px; background: var(--button-success-fg); }
833
+ .switch[data-state="checked"]::after,
834
+ .switch[aria-checked="true"]::after { transform: translateX(calc(var(--switch-width, 44px) - var(--switch-height, 24px))); background: var(--button-success-fg); }
835
+ .checkbox:focus-visible,
836
+ .switch:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--shadow-focus); }
@@ -1,4 +1,7 @@
1
1
  /* -- Document base ------------------------------------------------- */
2
+ /* Native scrollbars, controls and autofill follow the mode. */
3
+ :root { color-scheme: light; }
4
+ .dark { color-scheme: dark; }
2
5
  html {
3
6
  background: var(--html-bg);
4
7
  color: var(--text);
@@ -33,7 +36,6 @@ body {
33
36
  .num, .tabular {
34
37
  font-family: var(--font-mono);
35
38
  font-variant-numeric: tabular-nums;
36
- font-feature-settings: "tnum";
37
39
  }
38
40
 
39
41
  h1, .h1 {