@filipgutica/design-system 2.2.0 → 2.4.0
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/language/DESIGN.md +17 -4
- package/language/components.html +68 -18
- package/language/components.md +130 -23
- package/language/decisions.md +50 -48
- package/language/reference.html +18 -12
- package/package.json +1 -1
package/language/decisions.md
CHANGED
|
@@ -2,53 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
Each entry records a choice this language made, the options it rejected, and why. Read it before you change a component, so a new project does not try a rejected option again. [Component specs](components.md) hold the values; this file holds the reasons.
|
|
4
4
|
|
|
5
|
-
| Decision | Layer | Chosen | Rejected, and why |
|
|
6
|
-
| --- | --- | --- | --- |
|
|
7
|
-
| Units | Core | Type (`--text-*`), spacing (`--space-*`), and control and row heights (`--control-*`, `--row`) are rem, as are the page literals that size text, padding, gaps, and line heights. Each equals its old pixel value at the default 16px root, so the default render does not change. Hairlines, focus rings and their offsets, shadows, fixed icon and box sizes, layout widths, and radii stay px. Media query breakpoints stay px and are out of scope here. | All px: text and controls ignored the reader's browser font-size setting. All rem: 1px hairlines and the 2px focus ring would grow or round to uneven widths. |
|
|
8
|
-
| Depth | Core | Quiet lift: borderless controls take one tight shadow at rest (`--shadow-raise`) and sink when pressed. Containers take a fainter edge (`--shadow-surface`). No outer light highlight, and no blur wider than 2px. A transparent 1px border stays for forced colors. | A dual raise (a dark blur below and a light highlight above) on controls and containers alike: cards looked heavy, idle buttons looked too raised, and dark mode showed a fuzzy halo. Before that, a crisp, bordered look. |
|
|
9
|
-
| Primary button | Core | Filled with the project hue (`--color-accent`), with `--color-accent-text`. | Plain ink (black in light, white in dark) looked too severe. Graphite ink looked disabled. |
|
|
10
|
-
| Danger button | Core | A raised `--color-error-surface` button with danger-tinted text, mixed toward `--color-text` as status badges are. Hover and press deepen the tint, and press sinks it. The label must read at 4.5:1 on all three fills; where the mix misses, it falls back to `--color-text`, black, or white. | A flat button with `--color-text` and a hover border read as a pink secondary button, and pressing it showed nothing. |
|
|
11
|
-
| Pressed button | Core | Every variant but text sinks 1px, takes `--shadow-sink`, and changes its fill. Press is a button state: other controls show their latched state, and quiet actions tint without sinking. | The sink shadow alone was too faint to show a click, especially on secondary and ghost. |
|
|
12
|
-
| Busy button | Core | Busy also disables the button, so it takes no hover or press. | A busy button that still hovered and pressed looked ready for a second click. |
|
|
13
|
-
| Quiet actions | Core | One recipe for Copy, Full size, dialog and drawer close, and the project trigger: transparent, `currentColor` at 12% on hover and 18% pressed, no sink, and the control ring. | Each had its own hover (`--color-row-hover`, a colour change only, or a 12% tint), so the same kind of action behaved differently. |
|
|
14
|
-
| One source per control | Core | Each control comes from the owning library's component or class, including a link styled as a button. | Local copies built from the same tokens drifted: a docs button had no raise and only faded when pressed. |
|
|
15
|
-
| Section mark | Identity | The `##` mark goes only on the page-level section headings (h2) of documentation, CLI tool, article, and product pages, which are mono with a `--color-border-subtle` rule above. Application and inline-visualization section headings are plain `--font-ui` semibold at `--text-xl` or smaller, with no mark and no rule. h3 and lower never take it. | The mark on every section heading: on a dense screen, such as a metrics dashboard with six sections, it repeated down the page and competed with the data. The mark on h2 and h3: deeper levels repeat more often. A per-page opt-out class: every application page would need to remember it. Dropping the mark: reading pages lose the folio identity that ties them to the `~/name` header. Mono application section headings without the mark: the mono face alone still reads as a document heading among compact sans rows. |
|
|
16
|
-
| Command plate | Identity | A dark plate tinted with the project hue (`--color-command-bg`). Terminal captures keep the neutral plate. | The near-black plate looked too severe. |
|
|
17
|
-
| Navigation current row | Core | A quiet lifted fill (`--color-nav-current`, `--shadow-nav-current`) with 6px corners (`--radius-inline`) and accent text. In-page location is a 3×14 accent pip with no fill in strips and contents lists; a section rail's current section takes the current-page fill instead (see Rail current section). In forced colors the current page and a rail's current section take a `Highlight` edge, and the pip redraws in `Highlight`. | A raised pill looked odd. The old 2px inset bar curved away on rounded rows and disappeared in the dark drawer. |
|
|
18
|
-
| Fields | Core | 10px rounded rectangles (`--radius-field`) with a 1px `--color-border-subtle` edge (`--color-field-edge`) in both themes. Light fields take a `--color-surface-raised` fill and no shadow (`--color-field-bg`, `--shadow-field`). Dark fields stay in the sunk `--color-well` well with `--shadow-sink`; the well is about 1.01:1 against the canvas, so the edge carries the shape. A disabled field takes the `--color-well` well and no shadow. `--color-well` itself still fills tracks, pressed buttons, and selected radio cards. | Pill fields, the earlier shape. A grey sunk well with a transparent edge in light: the user said it looked disabled. Without the edge, dark fields disappeared. |
|
|
19
|
-
| Switch | Core | Borderless track, 44×22 with an 18px knob. The off state shows through the track fill. | A visible track border, which was not needed. |
|
|
20
|
-
| Segmented control | Core | One thumb glides between options: the leading edge takes 260ms and the trailing edge 300ms, with CSS `ease`, so the thumb stretches a little on the way. This was matched frame by frame to a reference. There is no motion on load, on a restored value, or on a theme change. Reduced motion makes the change instant. | The earlier 180ms ease-out looked like a jump. |
|
|
21
|
-
| Segmented label | Core | The selected label reads at 4.5:1 on its thumb, and an icon at 3:1 (`--color-segmented-current-text`): `--color-accent`, or the first of `--color-text`, black, and white that reads. | Accent at 3:1 for labels too, which let some hues' text fall below 4.5:1. |
|
|
22
|
-
| Phone drawer trigger | Core | A page-level contents drawer opens from a soft secondary button with a three-line menu glyph and a label. The no-JavaScript fallback keeps a chevron, because it opens in place. The site shell opens its drawer from the header's icon-only Menu button instead (see Phone header). | A down chevron promised a dropdown, but the trigger opens a side drawer. |
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
| Selected
|
|
42
|
-
| Selected
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
| Live example
|
|
48
|
-
| Live example
|
|
49
|
-
| Live example
|
|
50
|
-
| Live example
|
|
51
|
-
|
|
|
5
|
+
| Decision | Layer | Chosen | Rejected, and why | Guarded by |
|
|
6
|
+
| --- | --- | --- | --- | --- |
|
|
7
|
+
| Units | Core | Type (`--text-*`), spacing (`--space-*`), and control and row heights (`--control-*`, `--row`) are rem, as are the page literals that size text, padding, gaps, and line heights. Each equals its old pixel value at the default 16px root, so the default render does not change. Hairlines, focus rings and their offsets, shadows, fixed icon and box sizes, layout widths, and radii stay px. Media query breakpoints stay px and are out of scope here. | All px: text and controls ignored the reader's browser font-size setting. All rem: 1px hairlines and the 2px focus ring would grow or round to uneven widths. | rem sizes: `tests/design-foundations.test.mjs` "type, spacing, and control sizes are rem on every page, in tokens.css, and in the report stylesheet" |
|
|
8
|
+
| Depth | Core | Quiet lift: borderless controls take one tight shadow at rest (`--shadow-raise`) and sink when pressed. Containers take a fainter edge (`--shadow-surface`). No outer light highlight, and no blur wider than 2px. A transparent 1px border stays for forced colors. | A dual raise (a dark blur below and a light highlight above) on controls and containers alike: cards looked heavy, idle buttons looked too raised, and dark mode showed a fuzzy halo. Before that, a crisp, bordered look. | shadows from tokens: `tests/design-foundations.test.mjs` "pages take depth from tokens.css: no literal shadow outside a focus ring or divider"; raise and sink recipe: no test yet |
|
|
9
|
+
| Primary button | Core | Filled with the project hue (`--color-accent`), with `--color-accent-text`. | Plain ink (black in light, white in dark) looked too severe. Graphite ink looked disabled. | label contrast in every state: `tests/catalogue/catalogue.spec.ts` "contrast: every enabled primary button label reaches 4.5:1"; hue fill: no test yet |
|
|
10
|
+
| Danger button | Core | A raised `--color-error-surface` button with danger-tinted text, mixed toward `--color-text` as status badges are. Hover and press deepen the tint, and press sinks it. The label must read at 4.5:1 on all three fills; where the mix misses, it falls back to `--color-text`, black, or white. | A flat button with `--color-text` and a hover border read as a pink secondary button, and pressing it showed nothing. | label contrast on all three fills: `tests/catalogue/catalogue.spec.ts` "contrast: every enabled danger button label reaches 4.5:1"; fills, raise, and sink: no test yet |
|
|
11
|
+
| Pressed button | Core | Every variant but text sinks 1px, takes `--shadow-sink`, and changes its fill. Press is a button state: other controls show their latched state, and quiet actions tint without sinking. | The sink shadow alone was too faint to show a click, especially on secondary and ghost. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; 1px move, sink, and fill: no test yet |
|
|
12
|
+
| Busy button | Core | Busy also disables the button, so it takes no hover or press. | A busy button that still hovered and pressed looked ready for a second click. | No test yet |
|
|
13
|
+
| Quiet actions | Core | One recipe for Copy, Full size, dialog and drawer close, and the project trigger: transparent, `currentColor` at 12% on hover and 18% pressed, no sink, and the control ring. | Each had its own hover (`--color-row-hover`, a colour change only, or a 12% tint), so the same kind of action behaved differently. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; tint recipe: no test yet |
|
|
14
|
+
| One source per control | Core | Each control comes from the owning library's component or class, including a link styled as a button. | Local copies built from the same tokens drifted: a docs button had no raise and only faded when pressed. | copied rules unchanged: `tests/design-foundations.test.mjs` "example pages copy the catalogue rules for the shared controls and components they use unchanged" |
|
|
15
|
+
| Section mark | Identity | The `##` mark goes only on the page-level section headings (h2) of documentation, CLI tool, article, and product pages, which are mono with a `--color-border-subtle` rule above. Application and inline-visualization section headings are plain `--font-ui` semibold at `--text-xl` or smaller, with no mark and no rule. h3 and lower never take it. | The mark on every section heading: on a dense screen, such as a metrics dashboard with six sections, it repeated down the page and competed with the data. The mark on h2 and h3: deeper levels repeat more often. A per-page opt-out class: every application page would need to remember it. Dropping the mark: reading pages lose the folio identity that ties them to the `~/name` header. Mono application section headings without the mark: the mono face alone still reads as a document heading among compact sans rows. | No test yet |
|
|
16
|
+
| Command plate | Identity | A dark plate tinted with the project hue (`--color-command-bg`). Terminal captures keep the neutral plate. | The near-black plate looked too severe. | text and prompt contrast: `tests/catalogue/catalogue.spec.ts` "contrast: the command plate text reaches 4.5:1", "contrast: the command plate prompt reaches 3:1"; plate tint: no test yet |
|
|
17
|
+
| Navigation current row | Core | A quiet lifted fill (`--color-nav-current`, `--shadow-nav-current`) with 6px corners (`--radius-inline`) and accent text. In-page location is a 3×14 accent pip with no fill in strips and contents lists; a section rail's current section takes the current-page fill instead (see Rail current section). In forced colors the current page and a rail's current section take a `Highlight` edge, and the pip redraws in `Highlight`. | A raised pill looked odd. The old 2px inset bar curved away on rounded rows and disappeared in the dark drawer. | accent text contrast: `tests/design-foundations.test.mjs` "accent text on the selected fill reaches 4.5:1 on every surface in both themes"; 6px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one"; pip and forced colors: no test yet |
|
|
18
|
+
| Fields | Core | 10px rounded rectangles (`--radius-field`) with a 1px `--color-border-subtle` edge (`--color-field-edge`) in both themes. Light fields take a `--color-surface-raised` fill and no shadow (`--color-field-bg`, `--shadow-field`). Dark fields stay in the sunk `--color-well` well with `--shadow-sink`; the well is about 1.01:1 against the canvas, so the edge carries the shape. A disabled field takes the `--color-well` well and no shadow. `--color-well` itself still fills tracks, pressed buttons, and selected radio cards. | Pill fields, the earlier shape. A grey sunk well with a transparent edge in light: the user said it looked disabled. Without the edge, dark fields disappeared. | 10px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one"; edge, fill, and depth: no test yet |
|
|
19
|
+
| Switch | Core | Borderless track, 44×22 with an 18px knob. The off state shows through the track fill. | A visible track border, which was not needed. | No test yet |
|
|
20
|
+
| Segmented control | Core | One thumb glides between options: the leading edge takes 260ms and the trailing edge 300ms, with CSS `ease`, so the thumb stretches a little on the way. This was matched frame by frame to a reference. There is no motion on load, on a restored value, or on a theme change. Reduced motion makes the change instant. | The earlier 180ms ease-out looked like a jump. | No test yet |
|
|
21
|
+
| Segmented label | Core | The selected label reads at 4.5:1 on its thumb, and an icon at 3:1 (`--color-segmented-current-text`): `--color-accent`, or the first of `--color-text`, black, and white that reads. | Accent at 3:1 for labels too, which let some hues' text fall below 4.5:1. | label contrast: `tests/catalogue/catalogue.spec.ts` "contrast: every selected segmented label on its thumb reaches 4.5:1"; icon at 3:1: no test yet |
|
|
22
|
+
| Phone drawer trigger | Core | A page-level contents drawer opens from a soft secondary button with a three-line menu glyph and a label. The no-JavaScript fallback keeps a chevron, because it opens in place. The site shell opens its drawer from the header's icon-only Menu button instead (see Phone header). | A down chevron promised a dropdown, but the trigger opens a side drawer. | No test yet |
|
|
23
|
+
| Shape follows role | Core | A pill acts, or sets a value on one line (`--radius-control`). Small state marks are pills (`--radius-pill`). Places and picked rows are 6px (`--radius-inline`). Typed fields, and controls whose label wraps, are 10px (`--radius-field`). Containers are 16px (`--radius-panel`). A pill never holds text that can wrap, and nested rectangles are concentric. The token names predate the rule: they say inline, control, and field, where the uses are rows, pills, and typed fields. The names stay, because a rename is a major release. | One shape for every control. All pills put wrapping labels in pills, which the toggle card, fields, and the raised pill row already rejected; all rectangles lose the shape that marks an action. A list of components for each token with no reason: a new component had no rule to pick from, and a reader took a 6px row beside a pill for an error. | rendered corners by role: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one", "the DESIGN.md shape table names each role token with its value"; slider track and thumb, and select picker: `tests/design-foundations.test.mjs` "the slider track, slider thumb, and select picker take their role’s corners"; no literal radius: `tests/design-foundations.test.mjs` "no page or the report stylesheet writes a literal corner radius" |
|
|
24
|
+
| Navigation row corners | Core | Navigation rows, header and strip rows, list-selection rows, collapsible group labels, and tabs take 6px corners (`--radius-inline`). The owner chose the more rectangular rows from the Gate M mockup (2026-11-09). | 10px (`--radius-field`), the previous corners, shared with fields. | 6px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one"; Foundations swatch: `tests/design-foundations.test.mjs` "the Foundations current-row swatch and radius list follow the navigation row radius" |
|
|
25
|
+
| Optical label centring | Core | A text-only navigation row and the breadcrumb centre their label on the cap height with `text-box: trim-both cap alphabetic`, inside `@supports`; a row becomes a block with `align-content: center` for it, and `--space-2` block padding keeps a wrapped label clear of its fill's edges. Browsers without `text-box` keep the flex centring of the line box. Buttons, tabs, and segmented options already centre their ink within 0.5px, so they are unchanged; Chromium does not trim a button's label in any case. | Centring the line box alone: it keeps descender room, so a label without descenders, such as "Overview", sat 1.25px above centre in the 44px header row (15.75px above the ink, 18.25px below). `text-box` on the flex row itself: Chromium trims only block containers, and the label's anonymous flex item does not inherit the trim. A fixed nudge in em: it depends on the font's metrics, which an identity can change. | label inside the fill, and level with the strip: `tests/site/site.spec.ts` "a wrapped navigation row or crumb keeps its label inside the fill and focus ring in ${colorScheme}", "the breadcrumb's labels sit level with the header strip in ${colorScheme}" |
|
|
26
|
+
| Rail current section | Core | In a section rail the current section takes the current-page look: `--color-nav-current` fill, `--shadow-nav-current`, and `--color-nav-current-text`, with no pip. It keeps `aria-current="location"`. Strips and contents lists keep the pip. In forced colors it takes the current page's 2px `Highlight` leading border. The owner chose it at Gate M, so the rail's place reads like the live site's current page. | The pip in the rail too, as in strips and contents lists: the owner preferred the rail to match the site's current-page look. | rule present on pages: `tests/design-foundations.test.mjs` "example pages copy the state rules of every component variant their markup uses"; recipe: no test yet |
|
|
27
|
+
| Tab glide | Core | The selected tab's fill is a `::before` layer that glides between tabs like the segmented thumb: `glide-left` and `glide-right`, 260ms leading and 300ms trailing, with CSS `ease`. No glide on first render or under reduced motion, and no layer in forced colors. The owner chose it at Gate M. | The fill jumping from tab to tab, unlike the segmented control beside it. | glide and reduced motion: `tests/catalogue/catalogue.spec.ts` "the tab fill glides to the new tab", "the tab fill moves at once" |
|
|
28
|
+
| Segmented touch size | Core | At tablet width an unsized segmented control sets `--item` to `--control-lg`. | Growing only the buttons' `min-height`: `--item` stayed at `--control-md`, so icon-only options were 36×44 ovals (found at Gate M). | No test yet |
|
|
29
|
+
| Phone header | Core | Option A: at tablet width, with JavaScript, the header is one sticky row with the site name or a back link, then Find and Menu icon buttons. The Menu drawer holds Find, the pages, the appearance control, and the page's sections. The buttons cancel the scroll offset with a negative `scroll-margin-top`, so focusing one does not scroll the page. Without JavaScript nothing moves. The owner chose it at Gate M. | The proposal's first design, a second sticky bar under the header with a "<Label>: <current row>" trigger and a Find button: the owner chose the single row instead. | drawer and header buttons: `tests/catalogue/catalogue.spec.ts` "Menu opens the drawer on the current row, and a link closes it and focuses the target", "opening the drawer or focusing a header button does not scroll the page"; header layout: no test yet |
|
|
30
|
+
| Drawer instead of a long strip | Core | A horizontal strip holds 6 links or fewer; a longer list moves into the drawer at tablet width. | The catalogue's 26-link strip on phones: most links sat off screen, and the page broke its own drawer spec. | rail moves into the drawer: `tests/catalogue/catalogue.spec.ts` "resizing moves the rail, the pages, and the appearance control between the page and the drawer"; six-link strip limit: no test yet |
|
|
31
|
+
| Purpose groups | Core | The catalogue and `components.md` group components by purpose (Actions, Selection, Inputs, Feedback and status, Containers and overlays, Navigation, Code and examples, then Identity). Each section keeps its Core or Identity badge, and the heading ids stay unchanged, so old deep links still work. | Core, then Identity, in build order: a reader had to know a component's layer to find it. Splitting the catalogue into pages: agents copy from and grep one file, and the hosts serve a fixed list of files. | No test yet |
|
|
32
|
+
| Find and its shortcut | Core | A find field filters the rail; `/` focuses it. A saved switch in the rail footer turns single-key shortcuts off (WCAG 2.1.4), and the shortcut is ignored in editable elements and while a modal dialog is open. | No shortcut: Find is a long Tab away. A shortcut with no off switch: it fails WCAG 2.1.4 for speech and switch users. | shortcut and its switch: `tests/catalogue/catalogue.spec.ts` "/ focuses Find, types normally in a field, and does nothing once shortcuts are off" |
|
|
33
|
+
| No command palette | Core | Find, which filters the rail, and no command palette. Revisit when a site has more than one searchable index. | A command palette: Find already covers a single-page catalogue and a site of about 25 skills. | No test yet |
|
|
34
|
+
| One pager per page | Core | One pager at the end of `main`, for the sequence of pages. | A pager per component: on one page with a sticky rail it adds 26 repeated blocks. | No test yet |
|
|
35
|
+
| Header current page | Core | Header links are navigation rows 44px tall, and a link to the current page takes `aria-current="page"` with the current-page recipe. | Muted text links with no current state: the header did not show which page the reader was on. | No test yet |
|
|
36
|
+
| One scroll offset | Core | `html { scroll-padding-top }` is the only offset: any sticky bar plus `--space-4`. The location tracker reads the same value. | `scroll-margin-top` on each section: every page set its own value, and the tracker needs one inset to compare against. | No test yet |
|
|
37
|
+
| Specimen captions | Core | Every catalogue specimen has a caption that names its state, such as "Disabled" or "Rest, live". The owner chose it at Gate M. | Captions only on some specimens: a disabled or static specimen with no caption could read as broken. | every specimen captioned: `tests/catalogue/catalogue.spec.ts` "every specimen has a caption" |
|
|
38
|
+
| Focus ring | Core | One accent ring for every role but fields: `outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset)` (2px, 3px), with no glow, over the control's own shadow. Variants recolour it with `outline-color` only. `--color-focus` is `--color-accent`: 6.26:1 on the page, 5.72:1 on a surface, and 6.61:1 on a raised surface in light; 8.31:1, 7.85:1, and 7.39:1 in dark. Dark plates use `--color-project-dark`: 6.98:1 on the command plate on a light page, 7.48:1 on a dark page, and 8.53:1 on the terminal capture. Inspired by Astryx `focusDefaults` (`utils/focusOutline.stylex.ts`), which writes the width, accent colour, and offset once from tokens. The user chose it from rendered demos and accepted an accent ring around primary, danger, and selected controls. | The neutral ink ring (`--color-focus: var(--color-text)`, offset 2px), the previous choice; the user preferred the accent ring with a 3px gap in rendered demos. Before that, an accent ring on controls and a `--color-link` ring on links, tabs, and navigation rows: two ring hues, cyan around the purple selected tab and current row. A ring in each control's own tone, such as `--color-error` around the danger button: every role needs its own ring rule, and the ring changes colour from control to control. A 2px ring with a 6px accent halo felt jarring, and a 1.5px ring was hard to see; Chromium drew it 1px at 1x. | one accent ring: `tests/design-foundations.test.mjs` "every focus ring is the one accent ring: no per-role ring colour or hand-written ring on any page or in tokens.css"; ring contrast: `tests/design-foundations.test.mjs` "the accent focus ring reaches 3:1 on --color-bg, --color-surface, and --color-surface-raised in both themes" |
|
|
39
|
+
| Page colours outside the base layer | Core | `tokens.css` sets the body background and text colour unlayered; the rest of the base stays in `@layer base`, so component rules still outrank it. | Everything in the layer: a host that wraps the page in its own unlayered reset, such as an artifact viewer, kept its light body while the tokens switched to dark, so token-coloured text sat near-white on white. A note telling each page to restate the body: every delivered page would need to remember it, and the failure only shows in dark mode. | unlayered page colours: `tests/design-foundations.test.mjs` "keeps the page background and text colour outside the base layer, so a host reset cannot win" |
|
|
40
|
+
| Field focus | Core | No ring. The 1px edge turns `--color-accent` with a 2px inset line of the accent at 18% (`--shadow-field-focus`; `--shadow-field-focus-invalid` for an invalid field), and the fill does not change in either theme. An invalid field keeps `--color-error` for the edge and the line. Forced colors drop the line, so a focused field there draws a `Highlight` outline 1px inside its edge. Inspired by Astryx `Field/inputStyles.stylex.ts`: a full accent border with an inset muted-accent line, and `Highlight` in forced colors. The user approved it from rendered demos. | The control ring plus a lift out of the well onto the control surface (`--field-focus`, `--color-control-thumb`, `--shadow-raise`), the previous choice, replaced by the edge the user chose from rendered demos. Before that, the lift with a 35% accent edge and no ring, which measured below 3:1 in light, and an accent edge with a halo and an underline, which felt too heavy. | edge contrast of focused inputs (valid and invalid), selects, textareas, and search fields, light and dark: `tests/catalogue/catalogue.spec.ts` "contrast: every focused field edge, on its fill and on the surface around it reaches 3:1"; inset line and forced colors: no test yet |
|
|
41
|
+
| Selected tab | Core | The navigation row's lifted fill (`--color-nav-current`, `--shadow-nav-current`, accent text, 6px corners), with no underline. Navigation and tabs share one selected state. | A 2px accent underline curved at rounded corners and did not match navigation. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; 6px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one"; fill recipe: no test yet |
|
|
42
|
+
| Selected text | Core | The first of accent, body text, black, and white that reaches 4.5:1 over the rendered current-row fill, on the page and on a surface (`--color-nav-current-text`). | Accent text everywhere: the accent is validated only at 3:1, so some hues miss 4.5:1 as text on the fill. | accent text at 4.5:1: `tests/design-foundations.test.mjs` "accent text on the selected fill reaches 4.5:1 on every surface in both themes"; fallback order: no test yet |
|
|
43
|
+
| Selected tint | Core | The current row, selected tabs, and selected list rows take an accent tint: `--color-accent` at 14% over `--color-surface-raised` in light, at 20% over transparent in dark, and the capture's terminal accent at 20%. With the default hue, accent text measures 5.34:1 in light, and in dark 5.87:1 on `--color-bg`, 5.42:1 on `--color-surface`, and 5.05:1 on `--color-surface-raised`. The filip-stack site hue measures 4.94:1 in light and at least 5.06:1 in dark. A hue that misses 4.5:1 takes another `--color-nav-current-text`. | The plain white fill vanished on near-white panels, such as the light phone drawer. An 8% light tint (14% in dark): the light fill measured 1.07:1 against the page and read as nearly invisible. | tint keeps accent text at 4.5:1: `tests/design-foundations.test.mjs` "accent text on the selected fill reaches 4.5:1 on every surface in both themes"; quoted ratios: no test yet |
|
|
44
|
+
| Toggle card | Core | A 10px card (`--radius-field`). It is the named exception to borderless raised controls: a visible `--color-border-subtle` edge and no rest raise. Pressed, it takes an 8% accent tint over `--color-surface-raised` and a 35% accent hairline, and the switch carries the on state. Pressed text measures 15.99:1 in light and 12.15:1 in dark; muted text 6.28:1 and 5.79:1. | A pill with a solid accent border looked heavy, and wrapped labels sat badly in pill corners. | label and description contrast, and the quoted ratios: `tests/catalogue/catalogue.spec.ts` "contrast: every enabled toggle card label and description reaches 4.5:1", "contrast: the toggle card ratios in decisions.md match the render"; 10px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one"; edge and hairline: no test yet |
|
|
45
|
+
| List selection | Core | A selected list row takes the navigation row's current recipe: `--color-nav-current` fill, `--shadow-nav-current`, medium weight, and `--color-nav-current-text` on its primary text. Dividers are straight pseudo-element lines inset by the row padding, hidden next to a filled row. In forced colors, a 2px `Highlight` border on the leading edge. | A 2px inset accent bar: it curved away on rounded rows, and the same bar was already rejected for navigation. A straight square bar beside a rounded fill: a second selection mark that navigation and tabs do not have. Square-cornered rows: they would break the rounded row shape shared with navigation and the select picker. | no inset bar: `tests/design-foundations.test.mjs` "no page marks a selected row with an inset accent bar"; row recipe: no test yet |
|
|
46
|
+
| Code blocks | Core | `text-size-adjust: 100%` on code, and prompts aligned to the line's baseline. | iOS Safari enlarged one line of wrapped code and left the `$` prompt misaligned. | No test yet |
|
|
47
|
+
| Live example layout | Core | Stage over source: one frame with the live preview on top and its code below one hairline, no header row and no language label, and Copy in the code's top right corner. shadcn/ui, Radix Themes, Mantine, Tailwind, Nuxt UI, React Aria, Primer, MUI, and Vuetify also stack preview over code. | A preview box and a code box, each with its own header at a different height, read as two unrelated boxes. | No test yet |
|
|
48
|
+
| Live example side by side | Core | Stage over source, at every width. | Preview and code side by side: a tall preview leaves the code column empty, long code leaves the preview floating, and the order breaks when the columns stack on phones. | No test yet |
|
|
49
|
+
| Live example code view | Core | The preview and its code show together. | Preview and Code tabs, as in Chakra UI: the reader never sees the element and its code together, the frame changes height with the tab, and reading the code takes an extra click. Storybook hides code by default, for the same cost. | No test yet |
|
|
50
|
+
| Live example stage | Core | The stage sits on the page background (`--color-bg`), not in a well or a panel. It is the named exception to the container depth tier. | A raised or inset stage changes the surface under the preview, so raised controls do not look as they do on a page. | No test yet |
|
|
51
|
+
| Live example source | Core | Inside the frame, the code block drops its own radius, border, and shadow, and spans the frame's width. The frame draws the one edge. | A rounded well with its own edge and shadow inside the frame is a frame inside a frame. | No test yet |
|
|
52
|
+
| Token names | Core | One set of names, shared with `@filipgutica/ui`: `--color-*` for colours, `--shadow-*` for shadows, and ui's type, radius, and font names. See [Token names](#token-names). | Two sets, the [1.x short names](#token-names) here and `--color-*` names in ui: every site and agent translated between them through `ui:` comments, and the 1.x control radius used Tailwind's `-md` name for a 999px pill where Tailwind's is 0.375rem. Short names everywhere: about 920 references in 27 files across six repositories, a ui major release, and 18 new names. | no 1.x names: `tests/token-names.test.mjs` "no payload file uses a 1.x token name" |
|
|
52
53
|
|
|
53
54
|
## Token names
|
|
54
55
|
|
|
@@ -129,7 +130,8 @@ Prose patterns moved with the names: `--*-soft` is now `--color-*-surface`, and
|
|
|
129
130
|
|
|
130
131
|
## Open questions
|
|
131
132
|
|
|
132
|
-
- Rows inside a floating menu, such as the project menu: concentric with the
|
|
133
|
+
- Rows inside a floating menu, such as the project menu: concentric with the 16px menu (the panel radius minus `--space-1`, 12px), as select picker rows are, or 6px like other navigation rows. They are 6px for now, the Gate M choice for navigation rows; a later change settles it.
|
|
134
|
+
- The skip link: a floating layer, so the shape rule gives it `--radius-panel` (16px). It keeps `--radius-field` (10px) until the owner picks.
|
|
133
135
|
|
|
134
136
|
## Known gaps
|
|
135
137
|
|
package/language/reference.html
CHANGED
|
@@ -94,17 +94,17 @@
|
|
|
94
94
|
.search input::placeholder { color: var(--color-muted); }
|
|
95
95
|
/* The native clear button, quieted to a thin muted cross drawn with a mask. */
|
|
96
96
|
.search input::-webkit-search-cancel-button { width: 0.75rem; height: 0.75rem; margin-inline-start: var(--space-2); background: var(--color-muted); cursor: pointer; -webkit-appearance: none; appearance: none; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 2.5l7 7m0-7l-7 7' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
|
|
97
|
-
.search input::-webkit-search-cancel-button:hover { background: var(--color-text); }
|
|
97
|
+
.search input:where(:not(:disabled))::-webkit-search-cancel-button:hover { background: var(--color-text); }
|
|
98
98
|
/* Forced colors would drop the masked fill, so the cross opts out and takes the system text colour. */
|
|
99
99
|
/* Forced colors drop the inset line, so the focused field draws the system ring just inside its edge. */
|
|
100
100
|
@media (forced-colors: active) { .search:is(:has(input:focus-visible), .is-focus) { outline: var(--focus-width) solid Highlight; outline-offset: -1px; } }
|
|
101
|
-
@media (forced-colors: active) { .search input::-webkit-search-cancel-button, .search input::-webkit-search-cancel-button:hover { forced-color-adjust: none; background: CanvasText; } }
|
|
101
|
+
@media (forced-colors: active) { .search input::-webkit-search-cancel-button, .search input:where(:not(:disabled))::-webkit-search-cancel-button:hover { forced-color-adjust: none; background: CanvasText; } }
|
|
102
102
|
kbd { font-size: var(--text-xs); color: var(--color-muted); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-inline); padding: 0 var(--space-1); line-height: 1.125rem; background: var(--color-surface-raised); }
|
|
103
103
|
|
|
104
104
|
/* Tabs, for the Foundations specimens: components.html#tabs, unchanged. */
|
|
105
105
|
.tablist { --glide-lead: 260ms; --glide-trail: 300ms; display: flex; width: max-content; max-width: 100%; overflow-x: auto; padding: var(--space-1); isolation: isolate; }
|
|
106
106
|
.tab { position: relative; flex: none; min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-inline); background: transparent; color: var(--color-muted); font: var(--weight-medium) var(--text-md) / var(--leading) var(--font-ui); white-space: nowrap; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
107
|
-
.tab:is(:hover, .is-hover) { background: var(--color-row-hover); color: var(--color-text); }
|
|
107
|
+
.tab:is(:hover, .is-hover):where(:not(:disabled)) { background: var(--color-row-hover); color: var(--color-text); }
|
|
108
108
|
/* The selected tab takes the navigation row's lifted fill: one selected state for both. The fill is a
|
|
109
109
|
::before layer behind the label; in the catalogue it glides between tabs. */
|
|
110
110
|
.tab[aria-selected="true"] { background: transparent; color: var(--color-nav-current-text); }
|
|
@@ -171,9 +171,9 @@
|
|
|
171
171
|
/* List selection: components.html#navigation-list. Dividers are straight lines inset by the row
|
|
172
172
|
padding; a filled row (hovered or selected) hides the divider above it and the one below it. */
|
|
173
173
|
.row + .row::before { content: ""; position: absolute; inset: 0 var(--space-3) auto; border-top: 1px solid var(--color-border-subtle); }
|
|
174
|
-
.row:is(:hover, [aria-selected="true"])::before,
|
|
175
|
-
.row:is(:hover, [aria-selected="true"]) + .row::before { display: none; }
|
|
176
|
-
.row:hover { background: var(--color-row-hover); }
|
|
174
|
+
.row:is(:hover:where(:not(:disabled)), [aria-selected="true"])::before,
|
|
175
|
+
.row:is(:hover:where(:not(:disabled)), [aria-selected="true"]) + .row::before { display: none; }
|
|
176
|
+
.row:hover:where(:not(:disabled)) { background: var(--color-row-hover); }
|
|
177
177
|
/* The selected row takes the navigation row's current recipe; it comes after hover, so hover keeps the fill. */
|
|
178
178
|
.row[aria-selected="true"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); font-weight: var(--weight-medium); }
|
|
179
179
|
.row[aria-selected="true"] .title { color: var(--color-nav-current-text); }
|
|
@@ -247,6 +247,12 @@
|
|
|
247
247
|
.alert.warning { background: var(--color-warning-surface); } .alert.warning .icon { color: var(--color-warning); }
|
|
248
248
|
.alert.danger { background: var(--color-error-surface); } .alert.danger .icon { color: var(--color-error); }
|
|
249
249
|
.alert.info { background: var(--color-info-surface); } .alert.info .icon { color: var(--color-info); }
|
|
250
|
+
@media (forced-colors: active) {
|
|
251
|
+
/* The tone dot is a fill, so it opts out of adjustment and takes the label's system colour. */
|
|
252
|
+
.badge:is(.success, .warning, .danger, .info)::before { forced-color-adjust: none; background: CanvasText; }
|
|
253
|
+
/* An SVG keeps the colour it sets, so the status icon takes the system text colour. */
|
|
254
|
+
.alert .icon, .alert:is(.success, .warning, .danger, .info) .icon { color: CanvasText; }
|
|
255
|
+
}
|
|
250
256
|
|
|
251
257
|
/* Code block: components.html#code-block, unchanged. */
|
|
252
258
|
.code { width: 100%; max-width: var(--measure); min-width: 0; overflow: hidden; border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-code); color: var(--color-code-text); box-shadow: var(--shadow-surface); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
|
|
@@ -256,7 +262,7 @@
|
|
|
256
262
|
/* Copy is a quiet action; this sets its size and place. */
|
|
257
263
|
.copy { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; min-width: var(--control-lg); min-height: var(--control-lg); margin-left: auto; padding: var(--space-1) 0.375rem; color: inherit; }
|
|
258
264
|
/* The code block has its own palette, so its Copy keeps the plate's text colour on hover. */
|
|
259
|
-
.code .copy:is(:hover, .is-hover) { color: inherit; }
|
|
265
|
+
.code .copy:is(:hover, .is-hover):where(:not(:disabled)) { color: inherit; }
|
|
260
266
|
/* Inset: the code block clips its content. */
|
|
261
267
|
.code pre:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
262
268
|
.code .copy.quiet-action:is(:focus-visible, .is-focus) { outline-offset: calc(var(--focus-width) * -1); }
|
|
@@ -662,11 +668,11 @@
|
|
|
662
668
|
<h3 id="shape-title">Shape</h3>
|
|
663
669
|
<p class="note">Pill buttons, rounded fields and toggle cards, large-radius panels, and inline corners. Cards never take a pill.</p>
|
|
664
670
|
<ul class="specs">
|
|
665
|
-
<li class="spec" data-token="--radius-inline"><div class="spec-meta"><code>--radius-inline</code><span class="value"></span><span class="use">
|
|
666
|
-
<li class="spec" data-token="--radius-field"><div class="spec-meta"><code>--radius-field</code><span class="value"></span><span class="use">
|
|
667
|
-
<li class="spec" data-token="--radius-control"><div class="spec-meta"><code>--radius-control</code><span class="value"></span><span class="use">
|
|
668
|
-
<li class="spec" data-token="--radius-panel"><div class="spec-meta"><code>--radius-panel</code><span class="value"></span><span class="use">
|
|
669
|
-
<li class="spec" data-token="--radius-pill"><div class="spec-meta"><code>--radius-pill</code><span class="value"></span><span class="use">
|
|
671
|
+
<li class="spec" data-token="--radius-inline"><div class="spec-meta"><code>--radius-inline</code><span class="value"></span><span class="use">Places and picked rows: navigation rows, tabs, list rows, breadcrumb links, checkboxes, and keyboard keys</span></div><i class="shape-box" style="border-radius:var(--radius-inline)"></i></li>
|
|
672
|
+
<li class="spec" data-token="--radius-field"><div class="spec-meta"><code>--radius-field</code><span class="value"></span><span class="use">Typed fields and controls whose label wraps: inputs, selects, textareas, toggle cards, and pager links</span></div><i class="shape-box" style="border-radius:var(--radius-field)"></i></li>
|
|
673
|
+
<li class="spec" data-token="--radius-control"><div class="spec-meta"><code>--radius-control</code><span class="value"></span><span class="use">Pills that act or set a value: buttons, quiet actions, segmented controls, and their thumbs</span></div><i class="shape-box" style="border-radius:var(--radius-control)"></i></li>
|
|
674
|
+
<li class="spec" data-token="--radius-panel"><div class="spec-meta"><code>--radius-panel</code><span class="value"></span><span class="use">Containers: wells, plates, panels, radio cards, alerts, and floating layers</span></div><i class="shape-box" style="border-radius:var(--radius-panel)"></i></li>
|
|
675
|
+
<li class="spec" data-token="--radius-pill"><div class="spec-meta"><code>--radius-pill</code><span class="value"></span><span class="use">Small state marks: status badges, switch tracks, slider and progress tracks, and score pips</span></div><i class="shape-box" style="border-radius:var(--radius-pill)"></i></li>
|
|
670
676
|
</ul>
|
|
671
677
|
</section>
|
|
672
678
|
|