@filipgutica/design-system 1.0.0 → 1.0.2
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/README.md +30 -14
- package/dist/class/base.css +188 -0
- package/dist/class/themes/graphite-indigo.css +133 -0
- package/dist/themes/graphite-indigo.css +9 -0
- package/dist/tokens.d.ts +117 -0
- package/dist/tokens.js +222 -0
- package/dist/tokens.json +218 -0
- package/fonts/OFL-IBM-Plex-Mono.txt +93 -0
- package/fonts/OFL-IBM-Plex-Sans.txt +93 -0
- package/fonts/fonts.css +55 -0
- package/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/language/DESIGN.md +88 -33
- package/language/components.html +1059 -409
- package/language/components.md +291 -103
- package/language/decisions.md +133 -34
- package/language/docs.html +29 -25
- package/language/implementations.json +85 -0
- package/language/product.html +22 -22
- package/language/reference.html +238 -227
- package/language/tokens.css +142 -143
- package/language/visualizations/build-count-report.mjs +4 -2
- package/language/visualizations/report.css +2 -2
- package/package.json +37 -6
- package/scripts/build-tokens.mjs +0 -236
- package/tokens/graphite-indigo.json +0 -298
- /package/language/{themes → editor-themes}/graphite-indigo/LICENSE +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/README.md +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/SOURCE.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/THIRD_PARTY_NOTICES.md +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/graphite-indigo.t3-theme.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/package.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/themes/graphite-indigo-dark-color-theme.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/themes/graphite-indigo-light-color-theme.json +0 -0
package/language/decisions.md
CHANGED
|
@@ -2,40 +2,139 @@
|
|
|
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 (`--accent`), with `--accent-text`. | Plain ink (black in light, white in dark) looked too severe. Graphite ink looked disabled. |
|
|
10
|
-
| Danger button | Core | A raised `--
|
|
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 (`--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 `--border-subtle` rule above. Application and inline-visualization section headings are plain `--font-
|
|
16
|
-
| Command plate | Identity | A dark plate tinted with the project hue (`--command-bg`). Terminal captures keep the neutral plate. | The near-black plate looked too severe. |
|
|
17
|
-
| Navigation current row | Core | A quiet lifted fill (`--nav-current`, `--shadow-nav-current`) with
|
|
18
|
-
| Fields | Core | 10px rounded rectangles (`--radius-field`) with a 1px `--border-subtle` edge (`--field-edge`) in both themes. Light fields take a `--surface-raised` fill and no shadow (`--field-bg`, `--field
|
|
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 (`--segmented-current-text`): `--accent`, or the first of `--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 soft secondary button with a three-line menu glyph. The no-JavaScript fallback keeps a chevron, because it opens in place. | 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
|
-
|
|
|
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 breaks every page that uses them. | 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`), except rows inside a floating menu (see Floating-menu rows). 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
|
+
| Floating-menu rows | Core | Rows inside a floating menu, such as the project menu, are concentric with the 16px menu: `calc(var(--radius-panel) - var(--space-1))`, 12px, as select picker rows are. The owner approved it from the DS-3b comparison. | 6px like rail rows: a 6px row inside a 16px panel looks pinched. | 12px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one" |
|
|
26
|
+
| 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}" |
|
|
27
|
+
| 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 |
|
|
28
|
+
| 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" |
|
|
29
|
+
| 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 |
|
|
30
|
+
| 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 |
|
|
31
|
+
| 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 |
|
|
32
|
+
| 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 |
|
|
33
|
+
| 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" |
|
|
34
|
+
| 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 |
|
|
35
|
+
| 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 |
|
|
36
|
+
| 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 |
|
|
37
|
+
| 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 |
|
|
38
|
+
| 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" |
|
|
39
|
+
| 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" |
|
|
40
|
+
| 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" |
|
|
41
|
+
| 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 |
|
|
42
|
+
| 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 |
|
|
43
|
+
| 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 |
|
|
44
|
+
| 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 |
|
|
45
|
+
| 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 |
|
|
46
|
+
| 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 |
|
|
47
|
+
| 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 |
|
|
48
|
+
| 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 |
|
|
49
|
+
| 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 |
|
|
50
|
+
| 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 |
|
|
51
|
+
| 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 |
|
|
52
|
+
| 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 |
|
|
53
|
+
| 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" |
|
|
54
|
+
| Versioning | Core | Releases are 1.0.x patches while the system has no outside users, tagged `ds-v*` from the `ds-v1.0.0` seed. Every release, a breaking one included, is a patch; the release notes name a breaking change written as `!` or a `BREAKING CHANGE:` footer in the commit message. npm already holds 1.1.0 through 2.4.0 from the earlier `v*` series, so leaving 1.0.x means 2.5.0 or 3.0.0. | Semver majors and minors (2.x): the numbers signalled a maturity the system does not have yet. 0.0.x: npm already holds 1.0.0, and a `^0.0.1` range matches only 0.0.1. | patch cap: `tests/release.test.mjs` "the release analyzer caps feat, fix, and breaking changes, from a commit or a PR body, at a patch", "the release analyzer releases nothing for chore-only commits"; tag series: `tests/release.test.mjs` "the site version comes from the latest ds-v tag and ignores the earlier v tags" |
|
|
55
|
+
|
|
56
|
+
## Token names
|
|
57
|
+
|
|
58
|
+
The 2.0.0 token rename, in the earlier version series (see Versioning), renamed 56 short names to the names `@filipgutica/ui` already declared. No value changed. Each `tokens.css` line before the rename named its ui variable in a `ui:` comment, and that variable became the line's name. Where a comment named several, the first one did.
|
|
59
|
+
|
|
60
|
+
To update a page or stylesheet that still uses the old names, run `node scripts/rename-tokens.mjs <file>...`. It reads the table below. A test fails when an old name appears in `language/` outside this table.
|
|
61
|
+
|
|
62
|
+
Name a new token by these rules:
|
|
63
|
+
|
|
64
|
+
- Give it one name. `tokens.css`, the class flavour, and `@filipgutica/ui` all declare it under that name, with no alias.
|
|
65
|
+
- Use Tailwind 4's theme namespaces where one fits: `--color-<role>` for a colour, `--shadow-<role>` for a shadow, `--radius-<role>` for a radius, `--font-<role>` for a font family, and `--text-<step>` for a type size. Other families keep their prefix, such as `--space-*`, `--control-*`, `--weight-*`, and `--duration-*`.
|
|
66
|
+
- Name the role, not the value: `--color-error`, not `--color-red`.
|
|
67
|
+
- A component role that always has the same value as a general token is a ui role in the token JSON's `library.roles`, listed after the general name in its `ui:` comment. It is not a new `tokens.css` line.
|
|
68
|
+
- Do not reuse an old name from this table.
|
|
69
|
+
|
|
70
|
+
<!-- rename-table:start -->
|
|
71
|
+
Prose patterns moved with the names: `--*-soft` is now `--color-*-surface`, and `--code-*` is now `--color-code`, `--color-code-text`, and `--color-syntax-*`.
|
|
72
|
+
|
|
73
|
+
| Name before the 2.0.0 rename | Name after |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| `--project` | `--color-project` |
|
|
76
|
+
| `--project-dark` | `--color-project-dark` |
|
|
77
|
+
| `--font-sans` | `--font-ui` |
|
|
78
|
+
| `--bg` | `--color-bg` |
|
|
79
|
+
| `--surface` | `--color-surface` |
|
|
80
|
+
| `--surface-raised` | `--color-surface-raised` |
|
|
81
|
+
| `--surface-hover` | `--color-surface-muted` |
|
|
82
|
+
| `--field` | `--color-well` |
|
|
83
|
+
| `--field-bg` | `--color-field-bg` |
|
|
84
|
+
| `--field-edge` | `--color-field-edge` |
|
|
85
|
+
| `--field-shadow` | `--shadow-field` |
|
|
86
|
+
| `--control-thumb` | `--color-control-thumb` |
|
|
87
|
+
| `--nav-current` | `--color-nav-current` |
|
|
88
|
+
| `--nav-current-text` | `--color-nav-current-text` |
|
|
89
|
+
| `--segmented-current-text` | `--color-segmented-current-text` |
|
|
90
|
+
| `--row-hover` | `--color-row-hover` |
|
|
91
|
+
| `--row-selected` | `--color-row-selected` |
|
|
92
|
+
| `--border-subtle` | `--color-border-subtle` |
|
|
93
|
+
| `--border` | `--color-border` |
|
|
94
|
+
| `--text` | `--color-text` |
|
|
95
|
+
| `--text-muted` | `--color-muted` |
|
|
96
|
+
| `--overlay` | `--color-overlay` |
|
|
97
|
+
| `--accent` | `--color-accent` |
|
|
98
|
+
| `--accent-text` | `--color-accent-text` |
|
|
99
|
+
| `--accent-hover` | `--color-accent-hover` |
|
|
100
|
+
| `--button-hover` | `--color-button-hover` |
|
|
101
|
+
| `--link` | `--color-link` |
|
|
102
|
+
| `--focus` | `--color-focus` |
|
|
103
|
+
| `--success` | `--color-success` |
|
|
104
|
+
| `--warning` | `--color-warning` |
|
|
105
|
+
| `--danger` | `--color-error` |
|
|
106
|
+
| `--info` | `--color-info` |
|
|
107
|
+
| `--success-soft` | `--color-success-surface` |
|
|
108
|
+
| `--warning-soft` | `--color-warning-surface` |
|
|
109
|
+
| `--danger-soft` | `--color-error-surface` |
|
|
110
|
+
| `--info-soft` | `--color-info-surface` |
|
|
111
|
+
| `--command-bg` | `--color-command-bg` |
|
|
112
|
+
| `--command-border` | `--color-command-border` |
|
|
113
|
+
| `--terminal` | `--color-terminal` |
|
|
114
|
+
| `--terminal-text` | `--color-terminal-text` |
|
|
115
|
+
| `--terminal-border` | `--color-terminal-border` |
|
|
116
|
+
| `--terminal-caption` | `--color-terminal-caption` |
|
|
117
|
+
| `--terminal-caption-text` | `--color-terminal-caption-text` |
|
|
118
|
+
| `--terminal-shadow-nav-current` | `--shadow-nav-current-dark` |
|
|
119
|
+
| `--code-bg` | `--color-code` |
|
|
120
|
+
| `--code-text` | `--color-code-text` |
|
|
121
|
+
| `--code-key` | `--color-syntax-keyword` |
|
|
122
|
+
| `--code-string` | `--color-syntax-string` |
|
|
123
|
+
| `--code-number` | `--color-syntax-number` |
|
|
124
|
+
| `--code-comment` | `--color-syntax-comment` |
|
|
125
|
+
| `--radius-sm` | `--radius-inline` |
|
|
126
|
+
| `--radius-md` | `--radius-control` |
|
|
127
|
+
| `--radius-lg` | `--radius-panel` |
|
|
128
|
+
| `--shadow-popover` | `--shadow-dialog` |
|
|
129
|
+
| `--field-shadow-focus` | `--shadow-field-focus` |
|
|
130
|
+
| `--field-shadow-focus-invalid` | `--shadow-field-focus-invalid` |
|
|
131
|
+
<!-- rename-table:end -->
|
|
132
|
+
|
|
133
|
+
## Open questions
|
|
134
|
+
|
|
135
|
+
- The skip link: a floating layer, so the shape rule gives it `--radius-panel` (16px). It keeps `--radius-field` (10px) until the owner picks.
|
|
37
136
|
|
|
38
137
|
## Known gaps
|
|
39
138
|
|
|
40
|
-
- Field focus is a 1px `--accent` edge with a faint 2px inset line. The edge reaches 3:1 for a focus indicator (WCAG 1.4.11): 6.61:1 against the light field fill and 6.26:1 against `--bg`, and 8.43:1 and 8.31:1 in dark. It is thinner than the 2px perimeter that the WCAG 2.2 AAA focus appearance criterion (2.4.13) asks for; the inset line, at 18% of the accent, does not reach 3:1 on its own.
|
|
41
|
-
- In forced colors (high contrast), an invalid field shows the system edge, not the `--
|
|
139
|
+
- Field focus is a 1px `--color-accent` edge with a faint 2px inset line. The edge reaches 3:1 for a focus indicator (WCAG 1.4.11): 6.61:1 against the light field fill and 6.26:1 against `--color-bg`, and 8.43:1 and 8.31:1 in dark. It is thinner than the 2px perimeter that the WCAG 2.2 AAA focus appearance criterion (2.4.13) asks for; the inset line, at 18% of the accent, does not reach 3:1 on its own.
|
|
140
|
+
- In forced colors (high contrast), an invalid field shows the system edge, not the `--color-error` edge, focused or not; the error text carries the state. A visible high-contrast invalid edge needs an error colour validated against high-contrast fills.
|
package/language/docs.html
CHANGED
|
@@ -7,48 +7,52 @@
|
|
|
7
7
|
<link rel="stylesheet" href="tokens.css">
|
|
8
8
|
<style>
|
|
9
9
|
.frame { width: min(calc(var(--page-max) + var(--sidebar)), calc(100% - var(--space-12))); margin-inline: auto; }
|
|
10
|
-
.header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); min-height: var(--space-16); border-bottom: 1px solid var(--border-subtle); }
|
|
11
|
-
.brand { color: var(--text); font-weight: var(--weight-semibold); }
|
|
10
|
+
.header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); min-height: var(--space-16); border-bottom: 1px solid var(--color-border-subtle); }
|
|
11
|
+
.brand { color: var(--color-text); font-weight: var(--weight-semibold); }
|
|
12
12
|
.header nav { display: flex; gap: var(--space-6); }
|
|
13
13
|
.header a { display: inline-flex; align-items: center; min-height: var(--control-lg); font-size: var(--text-sm); }
|
|
14
14
|
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: var(--space-8); }
|
|
15
15
|
.sidebar { position: sticky; top: var(--space-6); align-self: start; display: grid; gap: var(--space-1); padding-block: var(--space-6); }
|
|
16
16
|
/* Navigation rows: components.html#navigation-list, unchanged. Only the rail's placement and spacing are local. */
|
|
17
|
-
.navlist a { position: relative; display: flex; align-items: center; min-height: var(--row); padding-inline: var(--space-3); border-radius: var(--radius-
|
|
18
|
-
.navlist a:is(:hover, .is-hover) { background: var(--row-hover); color: var(--text); text-decoration: none; }
|
|
19
|
-
.navlist a[aria-current="page"] { background: var(--nav-current); box-shadow: var(--shadow-nav-current); color: var(--nav-current-text); font-weight: var(--weight-medium); }
|
|
20
|
-
.navlist a[aria-current="location"] { color: var(--text); font-weight: var(--weight-medium); }
|
|
21
|
-
.navlist a[aria-current="location"]::before { content: ""; position: absolute; inset-inline-start: var(--space-1); width: 3px; height: 14px; border-radius: var(--radius-pill); background: var(--accent); }
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
.navlist a { position: relative; display: flex; align-items: center; min-height: var(--row); padding-inline: var(--space-3); border-radius: var(--radius-inline); color: var(--color-muted); font-size: var(--text-sm); text-decoration: none; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
|
|
18
|
+
.navlist a:is(:hover, .is-hover) { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; }
|
|
19
|
+
.navlist a[aria-current="page"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); font-weight: var(--weight-medium); }
|
|
20
|
+
.navlist a[aria-current="location"] { color: var(--color-text); font-weight: var(--weight-medium); }
|
|
21
|
+
.navlist a[aria-current="location"]::before { content: ""; position: absolute; inset-inline-start: var(--space-1); width: 3px; height: 14px; border-radius: var(--radius-pill); background: var(--color-accent); }
|
|
22
|
+
@supports (text-box: trim-both cap alphabetic) { .navlist a:not(:has(> *)) { display: block; align-content: center; padding-block: var(--space-2); text-box: trim-both cap alphabetic; } .navlist a:not(:has(> *))[aria-current="location"]::before { inset-block: 0; margin-block: auto; } }
|
|
23
|
+
/* The sidebar is a section rail: components.html#section-rail, unchanged. Its current section takes the current-page look, with no pip. */
|
|
24
|
+
:is(.rail, .rail-specimen) a[aria-current="location"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); }
|
|
25
|
+
:is(.rail, .rail-specimen) a[aria-current="location"]::before { content: none; }
|
|
26
|
+
/* Fills and shadows drop. The current page and the rail's current section take a system border; a
|
|
27
|
+
location outside a rail keeps its pip, redrawn in the system highlight. */
|
|
28
|
+
@media (forced-colors: active) { .navlist a[aria-current="page"] { border-inline-start: 2px solid Highlight; } .navlist a[aria-current="location"]::before { forced-color-adjust: none; background: Highlight; } :is(.rail, .rail-specimen) a[aria-current="location"] { border-inline-start: 2px solid Highlight; } }
|
|
25
29
|
main { min-width: 0; display: grid; gap: var(--space-12); padding-block: var(--space-8) var(--space-16); }
|
|
26
30
|
section { display: grid; gap: var(--space-4); min-width: 0; }
|
|
27
31
|
h1, h2 { font-family: var(--font-mono); }
|
|
28
32
|
h1 { font-size: var(--text-3xl); max-width: 24ch; }
|
|
29
33
|
h2 { font-size: var(--text-xl); }
|
|
30
34
|
/* The ## mark goes on page-level section headings only. It is decorative; the empty alternative text keeps it out of the accessible name. */
|
|
31
|
-
main > section > h2::before { content: "## " / ""; color: var(--accent); }
|
|
35
|
+
main > section > h2::before { content: "## " / ""; color: var(--color-accent); }
|
|
32
36
|
/* The main gap alone separates sections. The rule above each heading belongs to the heading, as in @filipgutica/ui. */
|
|
33
|
-
main > section > h2 { padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
|
|
34
|
-
p { max-width: var(--measure); color: var(--
|
|
37
|
+
main > section > h2 { padding-top: var(--space-4); border-top: 1px solid var(--color-border-subtle); }
|
|
38
|
+
p { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-reading); }
|
|
35
39
|
/* Command plate: dark in both themes and tinted with the hue. Text takes the terminal colour and the focus ring the dark-theme accent, so both read on the dark plate. */
|
|
36
|
-
.command { box-shadow: var(--shadow-surface); --focus: var(--project-dark); --text: var(--terminal-text); display: flex; align-items: center; gap: var(--space-3); max-width: var(--measure); padding: var(--space-1) var(--space-3); border: 1px solid var(--command-border); border-radius: var(--radius-
|
|
40
|
+
.command { box-shadow: var(--shadow-surface); --color-focus: var(--color-project-dark); --color-text: var(--color-terminal-text); display: flex; align-items: center; gap: var(--space-3); max-width: var(--measure); padding: var(--space-1) var(--space-3); border: 1px solid var(--color-command-border); border-radius: var(--radius-panel); background: var(--color-command-bg); color: var(--color-terminal-text); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
|
|
37
41
|
/* The prompt is drawn by CSS, so it is not copied and screen readers skip it. */
|
|
38
|
-
.command code::before { content: "$ " / ""; color: var(--project-dark); }
|
|
42
|
+
.command code::before { content: "$ " / ""; color: var(--color-project-dark); }
|
|
39
43
|
.command pre { min-width: 0; flex: 1; margin: 0; overflow-x: auto; font-size: var(--text-sm); }
|
|
40
44
|
/* Copy is a quiet action: components.html#quiet-action, unchanged. The page adds its size and colour only. */
|
|
41
|
-
:where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-
|
|
42
|
-
.quiet-action:is(:hover, .is-hover):where(:not(:disabled)) { color: var(--text); background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
45
|
+
:where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
46
|
+
.quiet-action:is(:hover, .is-hover):where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
43
47
|
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 18%, transparent); }
|
|
44
48
|
.quiet-action:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
45
|
-
.command button { flex: none; min-width: var(--control-lg); min-height: var(--control-lg); color: var(--terminal-caption-text); }
|
|
46
|
-
.meta, #copy-status { color: var(--
|
|
47
|
-
.definitions { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-3) var(--space-6); margin: 0; padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
|
|
49
|
+
.command button { flex: none; min-width: var(--control-lg); min-height: var(--control-lg); color: var(--color-terminal-caption-text); }
|
|
50
|
+
.meta, #copy-status { color: var(--color-muted); font-size: var(--text-sm); }
|
|
51
|
+
.definitions { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-3) var(--space-6); margin: 0; padding-top: var(--space-4); border-top: 1px solid var(--color-border-subtle); }
|
|
48
52
|
.definitions dt { font-family: var(--font-mono); font-size: var(--text-sm); }
|
|
49
|
-
.definitions dd { margin: 0; color: var(--
|
|
50
|
-
footer { padding-block: var(--space-6); border-top: 1px solid var(--border-subtle); color: var(--
|
|
51
|
-
@media (max-width: 800px) { .navlist a { min-height: var(--control-lg); } .layout { grid-template-columns: minmax(0, 1fr); gap: 0; } .sidebar { position: static; display: flex; flex-wrap: wrap; gap: var(--space-2); padding-block: var(--space-3); border-bottom: 1px solid var(--border-subtle); } .sidebar a { padding-inline: var(--space-2); } main { padding-top: var(--space-6); } .definitions { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); } .definitions dd { margin-bottom: var(--space-3); } }
|
|
53
|
+
.definitions dd { margin: 0; color: var(--color-muted); }
|
|
54
|
+
footer { padding-block: var(--space-6); border-top: 1px solid var(--color-border-subtle); color: var(--color-muted); font-size: var(--text-sm); }
|
|
55
|
+
@media (max-width: 800px) { .navlist a { min-height: var(--control-lg); } .layout { grid-template-columns: minmax(0, 1fr); gap: 0; } .sidebar { position: static; display: flex; flex-wrap: wrap; gap: var(--space-2); padding-block: var(--space-3); border-bottom: 1px solid var(--color-border-subtle); } .sidebar a { padding-inline: var(--space-2); } main { padding-top: var(--space-6); } .definitions { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); } .definitions dd { margin-bottom: var(--space-3); } }
|
|
52
56
|
@media (max-width: 640px) { .frame { width: calc(100% - var(--space-8)); } main { gap: var(--space-8); } }
|
|
53
57
|
</style>
|
|
54
58
|
</head>
|
|
@@ -56,7 +60,7 @@ footer { padding-block: var(--space-6); border-top: 1px solid var(--border-subtl
|
|
|
56
60
|
<div class="frame">
|
|
57
61
|
<header class="header"><a class="brand" href="docs.html">Documentation example</a><nav aria-label="Reference formats"><a href="reference.html">Application</a><a href="product.html">Product page</a></nav></header>
|
|
58
62
|
<div class="layout">
|
|
59
|
-
<nav class="sidebar navlist" aria-label="Documentation"><a href="#start">Getting started</a><a href="#structure">Structure</a><a href="#interaction">Interaction</a></nav>
|
|
63
|
+
<nav class="sidebar navlist rail" aria-label="Documentation"><a href="#start">Getting started</a><a href="#structure">Structure</a><a href="#interaction">Interaction</a></nav>
|
|
60
64
|
<main>
|
|
61
65
|
<section id="start"><h1>A smaller set of design decisions.</h1><p>Keep navigation, examples, and reference text in a balanced frame. The content stays left aligned and the first useful step is easy to find.</p><p class="meta">Illustrative setup command</p><div class="command"><pre><code id="command">npm install @example/ui</code></pre><button class="quiet-action" type="button" id="copy" aria-label="Copy installation command">Copy</button></div><p id="copy-status" role="status"></p></section>
|
|
62
66
|
<section id="structure"><h2>Let the structure do the work</h2><p>Use readable prose and clear section boundaries. Examples can use the full article width without stretching every paragraph.</p><dl class="definitions"><dt>Frame</dt><dd>The navigation and article are centered together.</dd><dt>Measure</dt><dd>Running text has a comfortable reading width.</dd><dt>Evidence</dt><dd>Commands, examples, and caveats stay near the task.</dd></dl></section>
|
|
@@ -66,7 +70,7 @@ footer { padding-block: var(--space-6); border-top: 1px solid var(--border-subtl
|
|
|
66
70
|
<footer>Design language reference. Content and package name are illustrative.</footer>
|
|
67
71
|
</div>
|
|
68
72
|
<script>
|
|
69
|
-
// Marks the section the reader is in: the last section whose top has reached the top of the
|
|
73
|
+
// Location tracking (DESIGN.md#navigation). Marks the section the reader is in: the last section whose top has reached the top of the
|
|
70
74
|
// viewport, or the last section once the page is scrolled to the end. After a jump (a link or a
|
|
71
75
|
// deep link) the target stays current until the reader scrolls, because a short page cannot
|
|
72
76
|
// scroll the target to the top. Without JavaScript the links still work; only the marker is missing.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"vue": {
|
|
3
|
+
"button": {
|
|
4
|
+
"component": "UiButton",
|
|
5
|
+
"url": "https://filipgutica.github.io/ui/#/components/button"
|
|
6
|
+
},
|
|
7
|
+
"checkbox-and-radio": {
|
|
8
|
+
"component": "UiCheckbox",
|
|
9
|
+
"url": "https://filipgutica.github.io/ui/#/components/checkbox"
|
|
10
|
+
},
|
|
11
|
+
"radio-card-group": {
|
|
12
|
+
"component": "UiRadioCardGroup",
|
|
13
|
+
"url": "https://filipgutica.github.io/ui/#/components/radio-card-group"
|
|
14
|
+
},
|
|
15
|
+
"switch": {
|
|
16
|
+
"component": "UiSwitch",
|
|
17
|
+
"url": "https://filipgutica.github.io/ui/#/components/switch"
|
|
18
|
+
},
|
|
19
|
+
"toggle-button": {
|
|
20
|
+
"component": "UiToggleButton",
|
|
21
|
+
"url": "https://filipgutica.github.io/ui/#/components/toggle-button"
|
|
22
|
+
},
|
|
23
|
+
"segmented-control": {
|
|
24
|
+
"component": "UiSegmentedControl",
|
|
25
|
+
"url": "https://filipgutica.github.io/ui/#/components/segmented-control"
|
|
26
|
+
},
|
|
27
|
+
"text-input-and-textarea": {
|
|
28
|
+
"component": "UiInput",
|
|
29
|
+
"url": "https://filipgutica.github.io/ui/#/components/input"
|
|
30
|
+
},
|
|
31
|
+
"select": {
|
|
32
|
+
"component": "UiSelect",
|
|
33
|
+
"url": "https://filipgutica.github.io/ui/#/components/select"
|
|
34
|
+
},
|
|
35
|
+
"field-wrapper": {
|
|
36
|
+
"component": "UiField",
|
|
37
|
+
"url": "https://filipgutica.github.io/ui/#/components/field"
|
|
38
|
+
},
|
|
39
|
+
"slider": {
|
|
40
|
+
"component": "UiSlider",
|
|
41
|
+
"url": "https://filipgutica.github.io/ui/#/components/slider"
|
|
42
|
+
},
|
|
43
|
+
"progress": {
|
|
44
|
+
"component": "UiProgress",
|
|
45
|
+
"url": "https://filipgutica.github.io/ui/#/components/progress"
|
|
46
|
+
},
|
|
47
|
+
"score": {
|
|
48
|
+
"component": "UiScore",
|
|
49
|
+
"url": "https://filipgutica.github.io/ui/#/components/score"
|
|
50
|
+
},
|
|
51
|
+
"tabs": {
|
|
52
|
+
"component": "UiTabs",
|
|
53
|
+
"url": "https://filipgutica.github.io/ui/#/components/tabs"
|
|
54
|
+
},
|
|
55
|
+
"badge": {
|
|
56
|
+
"component": "UiBadge",
|
|
57
|
+
"url": "https://filipgutica.github.io/ui/#/components/badge"
|
|
58
|
+
},
|
|
59
|
+
"alert": {
|
|
60
|
+
"component": "UiAlert",
|
|
61
|
+
"url": "https://filipgutica.github.io/ui/#/components/alert"
|
|
62
|
+
},
|
|
63
|
+
"surface-and-card": {
|
|
64
|
+
"component": "UiCard",
|
|
65
|
+
"url": "https://filipgutica.github.io/ui/#/components/card"
|
|
66
|
+
},
|
|
67
|
+
"figure": {
|
|
68
|
+
"component": "UiFigure",
|
|
69
|
+
"url": "https://filipgutica.github.io/ui/#/components/figure"
|
|
70
|
+
},
|
|
71
|
+
"dialog": {
|
|
72
|
+
"component": "UiDialog",
|
|
73
|
+
"url": "https://filipgutica.github.io/ui/#/components/dialog"
|
|
74
|
+
},
|
|
75
|
+
"drawer": {
|
|
76
|
+
"component": "UiDrawer",
|
|
77
|
+
"url": "https://filipgutica.github.io/ui/#/components/drawer"
|
|
78
|
+
},
|
|
79
|
+
"code-block": {
|
|
80
|
+
"component": "UiCodeBlock",
|
|
81
|
+
"url": "https://filipgutica.github.io/ui/#/components/code-block"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"react": {}
|
|
85
|
+
}
|
package/language/product.html
CHANGED
|
@@ -7,54 +7,54 @@
|
|
|
7
7
|
<link rel="stylesheet" href="tokens.css">
|
|
8
8
|
<style>
|
|
9
9
|
.frame { width: min(var(--page-wide), calc(100% - var(--space-12))); margin-inline: auto; }
|
|
10
|
-
.header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); min-height: var(--space-16); border-bottom: 1px solid var(--border-subtle); }
|
|
11
|
-
.brand { color: var(--text); font-weight: var(--weight-semibold); }
|
|
10
|
+
.header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); min-height: var(--space-16); border-bottom: 1px solid var(--color-border-subtle); }
|
|
11
|
+
.brand { color: var(--color-text); font-weight: var(--weight-semibold); }
|
|
12
12
|
.header nav { display: flex; gap: var(--space-6); }
|
|
13
13
|
.header a { display: inline-flex; align-items: center; min-height: var(--control-lg); font-size: var(--text-sm); }
|
|
14
14
|
.hero { display: grid; gap: var(--space-8); padding-block: var(--space-12); }
|
|
15
15
|
.copy { display: grid; justify-items: start; gap: var(--space-4); }
|
|
16
16
|
h1, .workflow > h2 { font-family: var(--font-mono); }
|
|
17
17
|
h1 { max-width: 18ch; font-size: var(--text-display); letter-spacing: var(--tracking-tight); }
|
|
18
|
-
.lead { max-width: 56ch; font-size: var(--text-reading); color: var(--
|
|
18
|
+
.lead { max-width: 56ch; font-size: var(--text-reading); color: var(--color-muted); }
|
|
19
19
|
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-6); }
|
|
20
20
|
/* The one primary action: components.html#button, unchanged. The page adds layout only. */
|
|
21
|
-
.btn { --depth: var(--shadow-raise); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-
|
|
21
|
+
.btn { --depth: var(--shadow-raise); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-control); background: var(--color-accent); color: var(--color-accent-text); box-shadow: var(--depth); font: var(--weight-medium) var(--text-md) / 1.25 var(--font-ui); letter-spacing: -0.01em; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
|
|
22
22
|
.btn[data-size="lg"] { min-height: var(--control-lg); padding: 0 var(--space-4); font-size: var(--text-lg); }
|
|
23
|
-
.btn:is(:hover, .is-hover):not(:disabled) { background: var(--button-hover); }
|
|
24
|
-
.btn:not(.secondary, .ghost, .danger, .text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--button-hover); }
|
|
23
|
+
.btn:is(:hover, .is-hover):not(:disabled) { background: var(--color-button-hover); }
|
|
24
|
+
.btn:not(.secondary, .ghost, .danger, .text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--color-button-hover); }
|
|
25
25
|
.btn:not(.text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { --depth: var(--shadow-sink); transform: translateY(1px); }
|
|
26
26
|
a.btn { text-decoration: none; }
|
|
27
27
|
.actions > a { min-height: var(--control-lg); display: inline-flex; align-items: center; }
|
|
28
28
|
figure { margin: 0; min-width: 0; }
|
|
29
29
|
/* Product evidence sits in a well: one quiet frame, no frame around it. */
|
|
30
|
-
.product-view { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-
|
|
31
|
-
.view-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); }
|
|
32
|
-
.view-header span { color: var(--
|
|
30
|
+
.product-view { background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-panel); overflow: hidden; }
|
|
31
|
+
.view-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--color-border-subtle); font-size: var(--text-sm); }
|
|
32
|
+
.view-header span { color: var(--color-muted); }
|
|
33
33
|
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); padding: var(--space-6); }
|
|
34
34
|
.board section { min-width: 0; }
|
|
35
|
-
.board h2 { font-size: var(--text-sm); color: var(--
|
|
36
|
-
.task { padding-block: var(--space-4); border-top: 1px solid var(--border-subtle); display: grid; gap: var(--space-2); }
|
|
37
|
-
.task code { font-size: var(--text-xs); color: var(--
|
|
35
|
+
.board h2 { font-size: var(--text-sm); color: var(--color-muted); padding-bottom: var(--space-3); }
|
|
36
|
+
.task { padding-block: var(--space-4); border-top: 1px solid var(--color-border-subtle); display: grid; gap: var(--space-2); }
|
|
37
|
+
.task code { font-size: var(--text-xs); color: var(--color-muted); }
|
|
38
38
|
.task p { font-size: var(--text-sm); }
|
|
39
|
-
figcaption { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--
|
|
40
|
-
.workflow { display: grid; gap: var(--space-6); padding-block: var(--space-12); border-top: 1px solid var(--border-subtle); }
|
|
39
|
+
figcaption { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--color-muted); }
|
|
40
|
+
.workflow { display: grid; gap: var(--space-6); padding-block: var(--space-12); border-top: 1px solid var(--color-border-subtle); }
|
|
41
41
|
.workflow > h2 { max-width: 24ch; font-size: var(--text-3xl); }
|
|
42
42
|
/* Page-level product sections take the decorative ## mark; headings inside the product view do not. */
|
|
43
|
-
.workflow > h2::before { content: "## " / ""; color: var(--accent); }
|
|
44
|
-
.workflow > p { max-width: var(--measure); color: var(--
|
|
43
|
+
.workflow > h2::before { content: "## " / ""; color: var(--color-accent); }
|
|
44
|
+
.workflow > p { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-reading); }
|
|
45
45
|
.evidence { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-8); align-items: start; }
|
|
46
46
|
.checks { margin: 0; padding: var(--space-2) var(--space-6); list-style: none; font-size: var(--text-sm); }
|
|
47
47
|
.checks li { display: grid; grid-template-columns: 16px 64px minmax(0, 1fr); align-items: center; gap: var(--space-3); min-height: var(--row); padding-block: var(--space-2); }
|
|
48
|
-
.checks li + li { border-top: 1px solid var(--border-subtle); }
|
|
49
|
-
.checks code { font-size: var(--text-xs); color: var(--
|
|
48
|
+
.checks li + li { border-top: 1px solid var(--color-border-subtle); }
|
|
49
|
+
.checks code { font-size: var(--text-xs); color: var(--color-muted); }
|
|
50
50
|
/* Status color goes on the icon; the text label carries the meaning. */
|
|
51
51
|
.checks svg { width: 16px; height: 16px; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
|
|
52
|
-
.checks .fail svg { stroke: var(--
|
|
53
|
-
.checks .pass svg { stroke: var(--success); }
|
|
52
|
+
.checks .fail svg { stroke: var(--color-error); }
|
|
53
|
+
.checks .pass svg { stroke: var(--color-success); }
|
|
54
54
|
.evidence-copy { display: grid; gap: var(--space-2); }
|
|
55
55
|
.evidence-copy h3 { font-size: var(--text-lg); }
|
|
56
|
-
.evidence-copy p { color: var(--
|
|
57
|
-
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-6); border-top: 1px solid var(--border-subtle); color: var(--
|
|
56
|
+
.evidence-copy p { color: var(--color-muted); font-size: var(--text-reading); }
|
|
57
|
+
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-6); border-top: 1px solid var(--color-border-subtle); color: var(--color-muted); font-size: var(--text-sm); }
|
|
58
58
|
@media (max-width: 800px) { h1 { font-size: var(--text-display-sm); } .workflow > h2 { font-size: var(--text-2xl); } .hero { padding-block: var(--space-8); } .board { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4); } .evidence { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); } .checks { padding-inline: var(--space-4); } .workflow { padding-block: var(--space-8); } .view-header { padding: var(--space-4); } }
|
|
59
59
|
@media (max-width: 640px) { .frame { width: calc(100% - var(--space-8)); } }
|
|
60
60
|
</style>
|