@filipgutica/design-system 1.0.6 → 1.0.8

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.
@@ -131,7 +131,7 @@ Controls use quiet depth and familiar shapes: borderless surfaces with one tight
131
131
  | --- | --- | --- | --- |
132
132
  | Acts, or sets a value in place with every option shown, on one line | Pill | `--radius-control` | Buttons other than the labelled contents trigger and its no-JavaScript summary, quiet actions other than the project-menu trigger, and segmented controls with their thumbs |
133
133
  | Small state mark | Pill | `--radius-pill` | Status badges, switch tracks and knobs, slider and progress tracks, score pips, and the in-page location pip |
134
- | A place, or a row you pick | 6px | `--radius-inline` | Navigation rows outside a floating menu, group labels, breadcrumb links, tabs, list rows, checkboxes, and keyboard keys |
134
+ | A place, or a row you pick | 6px | `--radius-inline` | Navigation rows outside a floating menu, group labels, breadcrumb links, the package catalogue's site name, tabs, list rows, checkboxes, and keyboard keys |
135
135
  | Something you type in, a control whose label wraps, or a one-line control that is not an action | 10px | `--radius-field` | Inputs, textareas, search fields, toggle cards, pager links, and one-line controls that are not actions: the select, the project-menu trigger, the labelled contents trigger and its no-JavaScript summary, and the skip link |
136
136
  | Holds other things | 16px | `--radius-panel` | Wells, plates, panels, cards, radio cards, alerts, code blocks, example frames, and floating layers |
137
137
 
@@ -182,7 +182,7 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
182
182
  | Local | Which page of this site? | Section rail, or a navigation strip of 6 links or fewer | `aria-current="page"`: the lifted fill |
183
183
  | In-page | Where am I on this page? | Section rail rows that point to `#id` | `aria-current="location"`: the lifted fill in a rail, a pip in strips and contents lists |
184
184
  | Sequential | What comes next? | Pager | `rel="prev"` and `rel="next"` |
185
- | Path | How do I get back up? | Breadcrumbs, only at depth 3 or more, or for a page outside its site's shell | The current page as text with `aria-current="page"` |
185
+ | Path | How do I get back up? | Breadcrumbs above the page title, on every page below the site's home page; never in the header | The current page as text with `aria-current="page"` |
186
186
  | Find | Where is X? | Find field that filters the rail | A live match count |
187
187
 
188
188
  - **`aria-current`.**
@@ -197,7 +197,7 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
197
197
  - Never mix URL-changing items and panel items in one set, and never give links `role="tab"`.
198
198
  - **Landmarks.**
199
199
  - Give every `<nav>` a unique name, and leave "navigation" out of it, because screen readers add that word.
200
- - Order: skip link, banner (the header), local navigation, `main`, contentinfo. Focus follows that order. At tablet width the Find and Menu buttons come before `main`.
200
+ - Order: skip link, banner (the header), local navigation, `main`, contentinfo. Focus follows that order. At tablet width the section rail's labelled trigger comes before `main`.
201
201
  - **Scroll offset.**
202
202
  - One offset: `html { scroll-padding-top }`, equal to any sticky bar plus `--space-4`. Sections do not set `scroll-margin-top`.
203
203
  - Use `scroll-behavior: smooth` only under `prefers-reduced-motion: no-preference`.
@@ -237,7 +237,7 @@ The personal sites are terminal tools that read Markdown and paths, so their ide
237
237
  - **Mono identity.** `--font-mono` (IBM Plex Mono) sets identity, the page titles and section headings of documentation, CLI tool, article, and product pages, navigation rails, metadata, captions, and the footer. `@filipgutica/ui` self-hosts IBM Plex; elsewhere the tokens fall back to the system stack.
238
238
  - **Headings.** Documentation, CLI tool, article, and product page titles are mono; application titles are `--font-ui`. Page-level section headings (h2) on documentation, CLI tool, article, and product pages are mono, start with a `##` mark in `--color-accent` (decorative, so screen readers skip it), and have a `--color-border-subtle` rule above the section. Application and inline-visualization section headings, and every h3 or lower, are plain `--font-ui` with no mark. Product pages and tool homes may use a mono `--text-display` title, stepping down to `--text-display-sm` on phones; keep a short heading measure, place supporting copy and the primary action nearby, and let the first product image enter the initial desktop viewport.
239
239
  - **Hue marks.** The hue also draws the `~/` header mark, the `##` mark on documentation, CLI tool, article, and product section headings, step numbers, and the `$` prompt.
240
- - **Header.** Personal product sites share a compact static header: a mono `~/name` identity with the `~/` in `--color-accent`, a project switcher, useful page links, appearance controls, and a solid `--color-text` rule below. Use the shared project registry for names, order, and destinations. Keep a gallery's existing application navigation structure.
240
+ - **Header.** Personal product sites share a compact static header: a mono `~/name` identity with the `~/` in `--color-accent`, a project switcher, useful page links, appearance controls, and a solid `--color-text` rule below. Use the shared project registry for names, order, and destinations; the design-system site's header starts with the same switcher. The identity is the same on every page, and the links sit at the same x on every page; the page's path goes in [breadcrumbs](components.md#breadcrumbs) above its title. Keep a gallery's existing application navigation structure.
241
241
  - **Appearance.** Personal pages share the built-in System/Light/Dark choice, through the header's picker. An explicitly selected custom gallery theme overrides that choice until the reader selects a built-in appearance. Preserve installed themes.
242
242
  - **Terminal plates.** Commands sit on a dark plate tinted with the project hue (`--color-command-bg`), in both themes. A shell command gets a `$` prompt in `--color-project-dark`, drawn by CSS so it never enters copied or accessible text. Short commands use a headerless compact row with an accessible Copy control. Terminal captures keep the neutral `--color-terminal` plate, with a mono status-line caption below the screen; tabs on a capture switch to mono.
243
243
  - **Steps.** A real sequence is an ordered list with mono numbers in `--color-accent` on a ruled leading column, an h3 title per step, and an optional result note on the last step.
@@ -356,7 +356,10 @@
356
356
  .navlist a:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
357
357
  /* Phone trigger: a secondary button with a three-line menu glyph, because it opens a side drawer. It shows the page’s
358
358
  contents and does not act, so it takes the field corner, as its no-JavaScript summary does. */
359
- .menu-glyph { border-radius: var(--radius-field); }
359
+ .menu-glyph { gap: var(--space-3); border-radius: var(--radius-field); }
360
+ /* Block padding lets a label that wraps grow the trigger and stay clear of its edges. The selector matches the
361
+ sized button's padding shorthand in specificity and comes after it, so it wins. */
362
+ .btn.menu-glyph { padding-block: var(--space-2); }
360
363
  .menu-glyph::before { content: ""; flex: none; width: 14px; height: 10px; border-block: 1.5px solid currentColor; background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat; }
361
364
  /* No-JavaScript fallback: the list opens in place. The summary is a secondary button with a chevron; only the chevron is local. */
362
365
  .rail-summary { list-style: none; width: max-content; max-width: 100%; border-radius: var(--radius-field); }
@@ -372,9 +375,19 @@
372
375
  /* Inset: the rail list scrolls. */
373
376
  .group-toggle:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
374
377
  /* Horizontal strip: the same rows in one line that scrolls sideways. The padding keeps the current row's shadow whole.
375
- A clipped edge fades over 24px, as tabs do; the script names the clipped ends in data-clip. */
376
- .navlist.strip { display: flex; width: auto; max-width: 100%; overflow-x: auto; padding: 0.125rem; }
378
+ A clipped edge fades over 24px, as tabs do; the script names the clipped ends in data-clip, and scrolls a
379
+ focused row clear of the fades (scroll-padding). The fade shows the overflow, so no scrollbar shows. */
380
+ .navlist.strip { display: flex; width: auto; max-width: 100%; overflow-x: auto; scroll-padding-inline: 24px; scrollbar-width: none; padding: 0.125rem; }
377
381
  .navlist.strip a { flex: none; white-space: nowrap; }
382
+ /* Each row is as wide as its label at the current row's weight, so becoming current moves nothing. A
383
+ hidden copy of the label (data-label, with empty alternative text) takes the row's width at that weight
384
+ and overlaps the label's own line by -1lh, so the row keeps one line's height and its text-box trim.
385
+ Without text-box the row is a flex column, so the copy stacks on the label rather than beside it.
386
+ Without lh there is no copy, so the label stays in place and only the width can change. */
387
+ @supports (margin-top: -1lh) {
388
+ .navlist.strip a[data-label] { flex-direction: column; align-items: stretch; justify-content: center; }
389
+ .navlist.strip a[data-label]::after { content: attr(data-label) / ""; display: block; margin-top: -1lh; font-weight: var(--weight-medium); visibility: hidden; }
390
+ }
378
391
  .navlist.strip[data-clip="start"] { mask-image: linear-gradient(to right, transparent, #000 24px); }
379
392
  .navlist.strip[data-clip="end"] { mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
380
393
  .navlist.strip[data-clip="start end"] { mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
@@ -390,9 +403,8 @@
390
403
  /* In a rail the current section takes the current-page look, with no pip. Strips and contents lists keep the pip. */
391
404
  :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); }
392
405
  :is(.rail, .rail-specimen) a[aria-current="location"]::before { content: none; }
393
- /* Tablet and phone: Find and Menu, icon-only and square, in the header row. */
394
- .section-bar { display: flex; gap: var(--space-2); }
395
- .section-bar .btn { width: var(--control-lg); padding: 0; }
406
+ /* Tablet and phone: the labelled trigger below the header. A long label wraps inside the button. */
407
+ .section-trigger { width: max-content; max-width: 100%; white-space: normal; text-align: start; }
396
408
 
397
409
  /* Find field: a search input with a leading icon and a trailing key hint. */
398
410
  .find { position: relative; display: block; width: 100%; max-width: 260px; }
@@ -406,23 +418,30 @@
406
418
  .find-empty .btn.text { margin-inline-start: calc(-1 * var(--space-1)); }
407
419
  .find-count { color: var(--color-muted); font-size: var(--text-xs); }
408
420
 
409
- /* Breadcrumbs. The separator is drawn by CSS, so it is not read. */
421
+ /* Breadcrumbs. The separators and the phone back mark are chevrons drawn with two borders of a turned
422
+ box, so there is no text to read. */
410
423
  .crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); }
411
424
  .crumbs li { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
412
- .crumbs li + li::before { content: "/" / ""; color: var(--color-muted); }
425
+ .crumbs li + li::before, .crumbs li:nth-last-child(2) a::before { width: 0.375rem; height: 0.375rem; border: solid currentColor; border-width: 1.5px 1.5px 0 0; }
426
+ /* Turned 45°, the chevron's ink sits right of its box's centre; the margins even out the gaps beside it. */
427
+ .crumbs li + li::before { content: ""; flex: none; margin-inline: -0.125rem 0.125rem; color: var(--color-muted); transform: rotate(45deg); }
413
428
  .crumbs a { display: inline-flex; align-items: center; min-height: var(--control-sm); border-radius: var(--radius-inline); color: var(--color-muted); text-decoration: none; }
414
429
  .crumbs a.is-hover { color: var(--color-text); text-decoration: underline; text-underline-offset: 0.2em; }
415
430
  @media (hover: hover) { .crumbs a:hover { color: var(--color-text); text-decoration: underline; text-underline-offset: 0.2em; } }
416
431
  .crumbs [aria-current="page"] { color: var(--color-text); font-weight: var(--weight-medium); overflow-wrap: anywhere; }
417
- /* Crumbs share the header row with the strip, so they centre on the cap height too. */
432
+ /* Crumbs centre their labels on the cap height, as navigation rows do. */
418
433
  @supports (text-box: trim-both cap alphabetic) {
419
434
  .crumbs a:not(:has(> *)) { display: block; align-content: center; padding-block: var(--space-2); text-box: trim-both cap alphabetic; }
420
- .crumbs [aria-current="page"], .crumbs li + li::before { text-box: trim-both cap alphabetic; }
435
+ .crumbs [aria-current="page"] { text-box: trim-both cap alphabetic; }
421
436
  }
422
- /* Phones show only the parent, as a back link; .is-back pins that for the specimen. */
437
+ /* A page-level trail sits on its text, not on its links' touch boxes: it moves up by half the room the
438
+ box adds around the line, and takes the same room back below, so the h1 does not move. */
439
+ .intro > .crumbs > ol { margin-block: calc((1lh - var(--control-sm)) / 2) calc((var(--control-sm) - 1lh) / 2); }
440
+ /* Phones show only the parent of a trail of three or more, as a back link; .is-back pins that for the specimen. */
423
441
  .crumbs.is-back li:not(:nth-last-child(2)) { display: none; }
424
442
  .crumbs.is-back li::before { content: none; }
425
- .crumbs.is-back li:nth-last-child(2) a::before { content: "‹\a0" / ""; }
443
+ .crumbs.is-back li:nth-last-child(2) a { position: relative; padding-inline-start: 0.875rem; }
444
+ .crumbs.is-back li:nth-last-child(2) a::before { content: ""; position: absolute; inset-inline-start: 0.25rem; top: 50%; transform: translateY(-50%) rotate(-135deg); }
426
445
 
427
446
  /* Pager: previous at the start, next always at the end. */
428
447
  .pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); width: 100%; padding-top: var(--space-6); border-top: 1px solid var(--color-border-subtle); }
@@ -636,10 +655,11 @@
636
655
  :is(.switch[aria-checked="true"] .switch-track, .toggle[aria-pressed="true"] .toggle-track)::after { background: HighlightText; }
637
656
  /* Fills and shadows drop. The current page takes a system border; the in-page location keeps
638
657
  its pip, redrawn in the system highlight, so the two still differ. */
639
- .navlist a[aria-current="page"] { border-inline-start: 2px solid Highlight; }
658
+ /* The padding absorbs each border, so a row keeps its width and its label does not move. */
659
+ .navlist a[aria-current="page"] { border-inline-start: 2px solid Highlight; padding-inline-start: calc(var(--space-3) - 2px); }
640
660
  .navlist a[aria-current="location"]::before { forced-color-adjust: none; background: Highlight; }
641
661
  /* A rail's current section has no pip, so it takes the current page's system border. */
642
- :is(.rail, .rail-specimen) a[aria-current="location"] { border-inline-start: 2px solid Highlight; }
662
+ :is(.rail, .rail-specimen) a[aria-current="location"] { border-inline-start: 2px solid Highlight; padding-inline-start: calc(var(--space-3) - 2px); }
643
663
  .key { border-color: CanvasText; }
644
664
  /* The tone dot is a fill, so it opts out of adjustment and takes the label's system colour. */
645
665
  .badge:is(.success, .warning, .danger, .info)::before { forced-color-adjust: none; background: CanvasText; }
@@ -659,12 +679,19 @@
659
679
  /* One scroll offset for every in-page jump; sections set no scroll-margin-top. The location tracker reads the same value. */
660
680
  html { scroll-padding-top: var(--space-4); }
661
681
  .frame { width: min(calc(var(--page-max) + var(--sidebar)), calc(100% - var(--space-12))); margin-inline: auto; }
662
- /* Header: the site name, the design system's pages as a navigation strip, and the appearance control. */
663
- .page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); min-height: var(--space-16); border-bottom: 1px solid var(--color-border-subtle); }
664
- .site-name { margin: 0 auto 0 0; font: var(--weight-semibold) var(--text-sm) / 1 var(--font-mono); }
665
- /* Header links are navigation rows at the site header's 44px. The strip's label shows only in the drawer. */
682
+ /* Header: the identity, the design system's pages as a navigation strip, and the appearance control.
683
+ On the site the identity is the project switcher. This package copy has no project registry, so it
684
+ shows the site name as text, in the switcher's type, with a ~/ mark one character wide before it. */
685
+ .page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); min-height: var(--space-16); border-bottom: 1px solid var(--color-text); }
686
+ .site-name { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-sm); margin: 0 auto 0 0; border-radius: var(--radius-inline); color: var(--color-text); font: var(--weight-semibold) var(--text-sm) / 1 var(--font-mono); text-decoration: none; }
687
+ .site-name::before { content: "~/" / ""; color: var(--color-accent); }
688
+ /* Desktop: the strip starts right after the identity, so its links sit at the same x on every page. */
689
+ @media (min-width: 801px) {
690
+ .page-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--space-8); }
691
+ .page-head > .strip { justify-self: start; }
692
+ }
693
+ /* Header links are navigation rows at the site header's 44px. */
666
694
  .page-head .strip a { min-height: var(--control-lg); }
667
- .navlist.strip > .group-label { display: none; }
668
695
  .layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: var(--space-8); }
669
696
  /* One column that may shrink below its content, so a long title or specimen cannot widen the page.
670
697
  A short page, such as one left by a find with no matches, keeps its rows at the top. */
@@ -704,7 +731,8 @@
704
731
  .state > :is(.field, .input, .select, .textarea, .search) { width: 220px; }
705
732
  .state .pager { padding-top: 0; border-top: 0; }
706
733
  .rail-specimen { display: grid; gap: var(--space-3); width: 240px; }
707
- .phone-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: min(100%, 360px); padding-block: var(--space-3); border-bottom: 1px solid var(--color-border-subtle); }
734
+ .phone-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); width: min(100%, 360px); padding-block: var(--space-2); border-bottom: 1px solid var(--color-text); }
735
+ .phone-head > .strip { flex-basis: 100%; margin-inline: -2px; }
708
736
 
709
737
  /* By purpose: each group with its components, in two balanced columns. */
710
738
  .index { display: grid; gap: var(--space-4); }
@@ -726,33 +754,25 @@
726
754
  .coverage td { color: var(--color-accent); }
727
755
  .coverage .none { color: var(--color-muted); }
728
756
 
729
- /* The menu drawer holds Find, the pages, the appearance control, and the rail's groups. */
757
+ /* The navigation drawer holds Find and the rail's groups. */
730
758
  .drawer .rail { position: static; height: auto; padding: 0; }
731
759
  .drawer .rail-list { overflow: visible; }
732
760
  .drawer .find { max-width: none; }
733
761
  /* The find field stays at the top of the drawer while the list scrolls under it. */
734
762
  .drawer .rail-find { position: sticky; top: calc(-1 * var(--space-4)); z-index: 1; margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) 0; padding: var(--space-4); background: var(--color-surface-raised); }
735
- .drawer .navlist.strip { display: grid; overflow: visible; margin-bottom: var(--space-4); padding: 0; }
736
- .drawer .navlist.strip > .group-label { display: block; }
737
- .drawer .navlist.strip a { white-space: normal; }
738
- .drawer-appearance { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
739
- .drawer-appearance > .group-label { padding-inline: var(--space-3); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
740
- .drawer-appearance > .segmented { justify-self: start; max-width: 100%; }
741
763
  /* A tap opens the drawer with focus on its body, which draws no ring; the rows show their own. */
742
764
  #nav-drawer-body:focus { outline: none; }
743
765
 
744
766
  @media (max-width: 800px) {
745
- /* With the script, the header is one sticky row with Find and Menu. --head-inset is its height, and
746
- in-page jumps land below it. */
747
- :root { --head-inset: calc(var(--control-lg) + 2 * var(--space-3) + 1px); }
748
- html { scroll-padding-top: calc(var(--head-inset) + var(--space-4)); }
749
- .page-head { padding-block: var(--space-3); }
750
- .page-head:has(> .section-bar) { position: sticky; top: 0; z-index: 5; flex-wrap: nowrap; background: var(--color-bg); }
751
- .page-head:has(> .section-bar) > .site-name { min-width: 0; }
752
- /* The buttons sit inside the scroll inset, so they cancel it; otherwise focusing one scrolls the page. */
753
- .page-head > .section-bar > * { scroll-margin-top: calc(-1 * (var(--head-inset) + var(--space-4))); }
754
- /* Without the script, the links take a second row and the rail stays in place above the content. */
755
- .page-head .strip { order: 3; flex-basis: 100%; margin-inline: -2px; }
767
+ /* The header is static and takes two rows: the identity and the appearance control, then the pages.
768
+ Where both do not fit on the first row, as at 320px, the appearance control wraps to its own row at
769
+ the start, and the name stays whole. Without the script the appearance control stays hidden, and the
770
+ rail stays in place above the content. */
771
+ .page-head { gap: var(--space-2) var(--space-3); padding-block: var(--space-2); }
772
+ .page-head > .site-name { min-height: var(--control-lg); white-space: nowrap; }
773
+ .page-head .strip { order: 3; flex-basis: 100%; margin-inline: -2px; container: pages / inline-size; }
774
+ /* With the script, the trigger sits just below the header, before the breadcrumb; main's top padding follows it. */
775
+ .section-trigger { margin-top: var(--space-2); }
756
776
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
757
777
  .layout > .rail { position: static; height: auto; padding-block: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
758
778
  .layout > .rail .rail-list { overflow: visible; }
@@ -769,15 +789,22 @@
769
789
  .check:not([data-size]), .switch:not([data-size]), .toggle:not([data-size]) { min-height: var(--control-lg); }
770
790
  .copy-link { width: var(--control-lg); height: var(--control-lg); }
771
791
  .crumbs a, .group-toggle { min-height: var(--control-lg); }
792
+ .intro > .crumbs > ol { margin-block: calc((1lh - var(--control-lg)) / 2) calc((var(--control-lg) - 1lh) / 2); }
772
793
  .folio-display { font-size: var(--text-display-sm); }
773
794
  }
795
+ /* On the narrowest phones the strip clips a link. Rows with 6px side padding keep at least 16px of it in
796
+ view under the 24px fade, so the clip shows. The strip queries its own width, since only the strip changes. */
797
+ @container pages (max-width: 340px) {
798
+ .page-head .strip a { padding-inline: 0.375rem; }
799
+ }
774
800
  @media (max-width: 640px) {
775
801
  /* Phones: a dialog becomes a bottom sheet with rounded top corners. */
776
802
  dialog.dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
777
- /* Breadcrumbs show only the parent, as a back link. */
778
- .crumbs li:not(:nth-last-child(2)) { display: none; }
779
- .crumbs li::before { content: none; }
780
- .crumbs li:nth-last-child(2) a::before { content: "‹\a0" / ""; }
803
+ /* A trail of three or more crumbs shows only the parent, as a back link; a two-crumb trail fits in full. */
804
+ .crumbs ol:has(> li:nth-child(3)) > li:not(:nth-last-child(2)) { display: none; }
805
+ .crumbs ol:has(> li:nth-child(3)) > li::before { content: none; }
806
+ .crumbs ol:has(> li:nth-child(3)) > li:nth-last-child(2) a { position: relative; padding-inline-start: 0.875rem; }
807
+ .crumbs ol:has(> li:nth-child(3)) > li:nth-last-child(2) a::before { content: ""; position: absolute; inset-inline-start: 0.25rem; top: 50%; transform: translateY(-50%) rotate(-135deg); }
781
808
  .pager { grid-template-columns: minmax(0, 1fr); }
782
809
  .pager a[rel="next"] { grid-column: 1; }
783
810
  .definitions { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-1); }
@@ -812,6 +839,9 @@
812
839
  <symbol id="i-menu" viewBox="0 0 16 16"><path d="M1.5 3.5h13M1.5 8h13M1.5 12.5h13"/></symbol>
813
840
  <symbol id="i-arrow-left" viewBox="0 0 16 16"><path d="M12.5 8h-9M7 4.5 3.5 8 7 11.5"/></symbol>
814
841
  <symbol id="i-arrow-right" viewBox="0 0 16 16"><path d="M3.5 8h9M9 4.5l3.5 3.5L9 11.5"/></symbol>
842
+ <symbol id="i-system" viewBox="0 0 16 16"><rect x="2" y="2.5" width="12" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11v3"/></symbol>
843
+ <symbol id="i-light" viewBox="0 0 16 16"><circle cx="8" cy="8" r="3"/><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1"/></symbol>
844
+ <symbol id="i-dark" viewBox="0 0 16 16"><path d="M13 9.5A5.5 5.5 0 0 1 6.5 3a5.5 5.5 0 1 0 6.5 6.5z"/></symbol>
815
845
  </svg>
816
846
 
817
847
  <a class="skip" href="#main">Skip to content</a>
@@ -819,19 +849,16 @@
819
849
  <div class="frame">
820
850
  <header class="page-head">
821
851
  <p class="site-name">Design system</p>
822
- <nav class="navlist strip" aria-label="Pages"><span class="group-label" aria-hidden="true">Pages</span><a href="reference.html#foundations">Foundations</a><a href="components.html" aria-current="page">Components</a><a href="reference.html">Application example</a><a href="docs.html">Documentation example</a><a href="product.html">Product page example</a></nav>
823
- <div class="segmented" role="group" aria-label="Appearance" data-live hidden>
824
- <button type="button" data-theme-choice="system" aria-pressed="true">System</button>
825
- <button type="button" data-theme-choice="light" aria-pressed="false">Light</button>
826
- <button type="button" data-theme-choice="dark" aria-pressed="false">Dark</button>
852
+ <nav class="navlist strip" aria-label="Pages"><a href="reference.html#foundations" data-label="Foundations">Foundations</a><a href="components.html" aria-current="page" data-label="Components">Components</a><a href="reference.html" data-label="Application example">Application example</a><a href="docs.html" data-label="Documentation example">Documentation example</a><a href="product.html" data-label="Product page example">Product page example</a></nav>
853
+ <div class="segmented" role="group" aria-label="Appearance" data-size="lg" data-icon-only data-live hidden>
854
+ <button type="button" data-theme-choice="system" aria-pressed="true" aria-label="System" title="System"><svg class="icon" aria-hidden="true"><use href="#i-system"/></svg></button>
855
+ <button type="button" data-theme-choice="light" aria-pressed="false" aria-label="Light" title="Light"><svg class="icon" aria-hidden="true"><use href="#i-light"/></svg></button>
856
+ <button type="button" data-theme-choice="dark" aria-pressed="false" aria-label="Dark" title="Dark"><svg class="icon" aria-hidden="true"><use href="#i-dark"/></svg></button>
827
857
  </div>
828
858
  </header>
829
859
 
830
- <!-- Phones: the script moves this bar into the header row, and the rail into the menu drawer. -->
831
- <div class="section-bar" id="section-bar" hidden>
832
- <button class="btn secondary" type="button" data-size="lg" id="section-find" aria-label="Find a component" aria-haspopup="dialog"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg></button>
833
- <button class="btn secondary" type="button" data-size="lg" id="section-menu" aria-label="Menu" aria-haspopup="dialog"><svg class="icon" aria-hidden="true"><use href="#i-menu"/></svg></button>
834
- </div>
860
+ <!-- Tablet and phone: the script moves the rail into the drawer and shows this trigger, which names the rail and its current section. -->
861
+ <button class="btn secondary menu-glyph section-trigger" type="button" data-size="lg" id="section-menu" aria-haspopup="dialog" hidden>Components</button>
835
862
 
836
863
  <div class="layout">
837
864
  <aside class="rail" id="rail" aria-label="Contents">
@@ -1250,7 +1277,7 @@
1250
1277
  <section class="component" id="drawer" data-layer="Core" aria-labelledby="drawer-title">
1251
1278
  <header><h3 id="drawer-title">Drawer</h3><span class="badge">Core</span><a href="components.md#drawer">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="drawer" aria-label="Copy link to Drawer" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
1252
1279
  <p class="purpose">A side panel, such as phone navigation.</p>
1253
- <dl class="guidance"><dt>Do</dt><dd>Use a drawer for navigation or supporting detail that slides in from the side, such as the phone menu, and open it from a named button.</dd><dt>Don’t</dt><dd>The page’s main task inside a drawer. The drawer holds navigation or detail; the task stays on the page.</dd></dl>
1280
+ <dl class="guidance"><dt>Do</dt><dd>Use a drawer for navigation or supporting detail that slides in from the side its trigger sits on, such as phone navigation, and open it from a named button.</dd><dt>Don’t</dt><dd>The page’s main task inside a drawer. The drawer holds navigation or detail; the task stays on the page.</dd></dl>
1254
1281
  <div class="row"><h4>Live</h4><div class="states">
1255
1282
  <div class="state"><button class="btn secondary menu-glyph" type="button" data-size="lg" data-open="live-drawer">Contents</button><span class="caption">Rest, live: a page’s contents trigger opens a side drawer</span></div>
1256
1283
  </div></div>
@@ -1273,9 +1300,8 @@
1273
1300
  <div class="state" inert><nav class="navlist" aria-label="Sample routes, pinned"><a href="#navigation-list" class="is-hover">Hover</a><a href="components.html" aria-current="page" class="is-hover">Current page, hover</a><a href="#navigation-list" aria-current="location">Current location</a><a href="#navigation-list" class="is-focus">Focus visible</a></nav><span class="caption">Hover, current page with hover, current location, and focus visible</span></div>
1274
1301
  </div></div>
1275
1302
  <div class="row"><h4>Drawer triggers</h4><div class="states">
1276
- <div class="state" inert><div class="section-bar"><button class="btn secondary" type="button" data-size="lg" aria-label="Menu"><svg class="icon" aria-hidden="true"><use href="#i-menu"/></svg></button></div><span class="caption">Rest: the site shell’s Menu button, in the header row; see Section rail</span></div>
1277
- <div class="state" inert><button class="btn secondary menu-glyph" type="button" data-size="lg">On this page</button><span class="caption">Rest: a page’s own contents drawer, such as a docs page’s On this page</span></div>
1278
- <div class="state" inert><button class="btn secondary menu-glyph is-active" type="button" data-size="lg">On this page</button><span class="caption">Pressed: the page’s contents trigger</span></div>
1303
+ <div class="state" inert><button class="btn secondary menu-glyph" type="button" data-size="lg">Components: By purpose</button><span class="caption">Rest: the rail’s name and the current section; see Section rail</span></div>
1304
+ <div class="state" inert><button class="btn secondary menu-glyph is-active" type="button" data-size="lg">On this page: Install</button><span class="caption">Pressed: a docs page’s On this page</span></div>
1279
1305
  <div class="state"><details class="rail-details"><summary class="btn secondary rail-summary" data-size="lg">On this page</summary><nav class="navlist" aria-label="On this page, no JavaScript"><a href="#navigation-list" aria-current="location">Rows</a><a href="#code-block">Next section</a></nav></details><span class="caption">Live: the contents trigger’s no-JavaScript fallback</span></div>
1280
1306
  </div></div>
1281
1307
  <div class="row"><h4>List selection</h4><div class="states">
@@ -1293,7 +1319,7 @@
1293
1319
  <div class="state" inert><div class="rail-specimen"><nav class="navlist" aria-label="Collapsible specimen"><button class="group-toggle" type="button" aria-expanded="true"><span>Inputs</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></button><a href="#section-rail">Select</a><a href="#section-rail">Slider</a><button class="group-toggle" type="button" aria-expanded="false"><span>Feedback</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></button></nav></div><span class="caption">Collapsible groups: Inputs open, Feedback closed</span></div>
1294
1320
  </div></div>
1295
1321
  <div class="row"><h4>Phone header</h4><div class="states">
1296
- <div class="state wide" inert><div class="phone-head"><p class="site-name">Design system</p><div class="section-bar"><button class="btn secondary" type="button" data-size="lg" aria-label="Find a component"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg></button><button class="btn secondary" type="button" data-size="lg" aria-label="Menu"><svg class="icon" aria-hidden="true"><use href="#i-menu"/></svg></button></div></div><span class="caption">Rest: the sticky header row at tablet width, with Find and Menu</span></div>
1322
+ <div class="state wide" inert><div class="phone-head"><details class="projects"><summary class="quiet-action" aria-label="Project: Design system, phone sample"><span>Design system</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></summary></details><div class="segmented" role="group" aria-label="Appearance, phone sample" data-size="lg" data-icon-only><button type="button" aria-pressed="true" aria-label="System" title="System"><svg class="icon" aria-hidden="true"><use href="#i-system"/></svg></button><button type="button" aria-pressed="false" aria-label="Light" title="Light"><svg class="icon" aria-hidden="true"><use href="#i-light"/></svg></button><button type="button" aria-pressed="false" aria-label="Dark" title="Dark"><svg class="icon" aria-hidden="true"><use href="#i-dark"/></svg></button></div><nav class="navlist strip" aria-label="Pages, phone sample"><a href="#section-rail" data-label="Overview">Overview</a><a href="#section-rail" data-label="Foundations">Foundations</a><a href="#section-rail" aria-current="page" data-label="Components">Components</a><a href="#section-rail" data-label="Themes">Themes</a></nav></div><button class="btn secondary menu-glyph" type="button" data-size="lg">Components: By purpose</button><span class="caption">Rest at tablet width: the switcher and appearance, then the pages, then the labelled trigger below the header</span></div>
1297
1323
  </div></div>
1298
1324
  </section>
1299
1325
 
@@ -1312,11 +1338,11 @@
1312
1338
  <section class="component" id="breadcrumbs" data-layer="Core" aria-labelledby="breadcrumbs-title">
1313
1339
  <header><h3 id="breadcrumbs-title">Breadcrumbs</h3><span class="badge">Core</span><a href="components.md#breadcrumbs">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="breadcrumbs" aria-label="Copy link to Breadcrumbs" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
1314
1340
  <p class="purpose">The path from the site to this page.</p>
1315
- <dl class="guidance"><dt>Do</dt><dd>Use breadcrumbs only at depth 3 or more, or on a page outside its site’s shell.</dd><dt>Don’t</dt><dd>A trail whose only crumb repeats the page’s h1.</dd></dl>
1341
+ <dl class="guidance"><dt>Do</dt><dd>Put the trail above the page’s h1 on every page below the site’s home page, and keep the project switcher in the header.</dd><dt>Don’t</dt><dd>A trail in the site header in place of the project switcher: the header changes from page to page, and the path reads as the page title.</dd></dl>
1316
1342
  <div class="row"><h4>Trail</h4><div class="states">
1317
1343
  <div class="state"><nav class="crumbs" aria-label="Breadcrumb, specimen"><ol><li><a href="#breadcrumbs">Design system</a></li><li><a href="#breadcrumbs">Components</a></li><li><span aria-current="page">Navigation</span></li></ol></nav><span class="caption">Rest, live; the current page is text</span></div>
1318
1344
  <div class="state" inert><nav class="crumbs" aria-label="Breadcrumb, pinned"><ol><li><a href="#breadcrumbs" class="is-hover">Design system</a></li><li><a href="#breadcrumbs" class="is-focus">Components</a></li><li><span aria-current="page">Navigation</span></li></ol></nav><span class="caption">Hover on Design system, focus visible on Components</span></div>
1319
- <div class="state" inert><nav class="crumbs is-back" aria-label="Breadcrumb, phone"><ol><li><a href="#breadcrumbs">Design system</a></li><li><a href="#breadcrumbs">Components</a></li><li><span aria-current="page">Navigation</span></li></ol></nav><span class="caption">Phone: the parent only, as a back link</span></div>
1345
+ <div class="state" inert><nav class="crumbs is-back" aria-label="Breadcrumb, phone"><ol><li><a href="#breadcrumbs">Design system</a></li><li><a href="#breadcrumbs">Components</a></li><li><span aria-current="page">Navigation</span></li></ol></nav><span class="caption">Phone, three or more crumbs: the parent only, as a back link</span></div>
1320
1346
  </div></div>
1321
1347
  </section>
1322
1348
 
@@ -1422,8 +1448,8 @@
1422
1448
  <div class="row"><h4>Closed</h4><div class="states">
1423
1449
  <div class="state wide"><div class="site-header">
1424
1450
  <details class="projects"><summary class="quiet-action" aria-label="Project: filip-stack"><span>filip-stack</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></summary><nav class="navlist" aria-label="Projects"><a href="#site-header">annoterm</a><a href="components.html" aria-current="page">filip-stack</a><a href="#site-header">ui</a></nav></details>
1425
- <div class="site-end"><nav class="navlist strip site-links" aria-label="Site links"><a href="components.html" aria-current="page">Docs</a><a href="#site-header">GitHub</a></nav>
1426
- <div class="segmented" role="group" aria-label="Color theme, sample" data-size="lg" data-icon-only><button type="button" aria-pressed="true" aria-label="System" title="System"><svg class="icon" aria-hidden="true" viewBox="0 0 16 16"><rect x="2" y="2.5" width="12" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11v3"/></svg></button><button type="button" aria-pressed="false" aria-label="Light" title="Light"><svg class="icon" aria-hidden="true" viewBox="0 0 16 16"><circle cx="8" cy="8" r="3"/><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1"/></svg></button><button type="button" aria-pressed="false" aria-label="Dark" title="Dark"><svg class="icon" aria-hidden="true" viewBox="0 0 16 16"><path d="M13 9.5A5.5 5.5 0 0 1 6.5 3a5.5 5.5 0 1 0 6.5 6.5z"/></svg></button></div>
1451
+ <div class="site-end"><nav class="navlist strip site-links" aria-label="Site links"><a href="components.html" aria-current="page" data-label="Docs">Docs</a><a href="#site-header" data-label="GitHub">GitHub</a></nav>
1452
+ <div class="segmented" role="group" aria-label="Color theme, sample" data-size="lg" data-icon-only><button type="button" aria-pressed="true" aria-label="System" title="System"><svg class="icon" aria-hidden="true"><use href="#i-system"/></svg></button><button type="button" aria-pressed="false" aria-label="Light" title="Light"><svg class="icon" aria-hidden="true"><use href="#i-light"/></svg></button><button type="button" aria-pressed="false" aria-label="Dark" title="Dark"><svg class="icon" aria-hidden="true"><use href="#i-dark"/></svg></button></div>
1427
1453
  </div>
1428
1454
  </div><span class="caption">Live: the project switcher opens, and Docs is the current page; the picker is a sample</span></div>
1429
1455
  </div></div>
@@ -1501,7 +1527,7 @@
1501
1527
  <div class="drawer-body"><nav class="navlist" aria-label="Contents"><a href="#button">Button</a><a href="#segmented-control">Segmented control</a><a href="#navigation-list" aria-current="location">Navigation list</a></nav></div>
1502
1528
  </dialog>
1503
1529
  <dialog class="drawer" id="nav-drawer" aria-labelledby="nav-drawer-title">
1504
- <div class="drawer-head"><h4 id="nav-drawer-title">Menu</h4><form method="dialog"><button class="quiet-action close" type="submit" aria-label="Close menu"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></form></div>
1530
+ <div class="drawer-head"><h4 id="nav-drawer-title">Components</h4><form method="dialog"><button class="quiet-action close" type="submit" aria-label="Close drawer"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></form></div>
1505
1531
  <div class="drawer-body" id="nav-drawer-body"></div>
1506
1532
  </dialog>
1507
1533
 
@@ -1574,14 +1600,17 @@
1574
1600
  if (value) value.value = `${r.value}%`;
1575
1601
  }));
1576
1602
 
1577
- // A list that scrolls sideways names its clipped ends in data-clip, so CSS fades only those edges.
1603
+ // A list that scrolls sideways names its clipped ends in data-clip, so CSS fades only those edges. An
1604
+ // edge with 12px or less hidden is not faded, because the fade would cover more than it hides. A focused
1605
+ // item scrolls clear of the fades, which the list's scroll-padding reserves.
1578
1606
  const trackClip = (list) => {
1579
1607
  const clip = () => {
1580
1608
  const hidden = list.scrollWidth - list.clientWidth;
1581
- const ends = [list.scrollLeft > 1 && 'start', list.scrollLeft < hidden - 1 && 'end'].filter(Boolean).join(' ');
1609
+ const ends = [list.scrollLeft > 12 && 'start', hidden - list.scrollLeft > 12 && 'end'].filter(Boolean).join(' ');
1582
1610
  if (ends) list.dataset.clip = ends; else delete list.dataset.clip;
1583
1611
  };
1584
1612
  list.addEventListener('scroll', clip, { passive: true });
1613
+ list.addEventListener('focusin', (e) => e.target.scrollIntoView({ block: 'nearest', inline: 'nearest' }));
1585
1614
  new ResizeObserver(clip).observe(list);
1586
1615
  };
1587
1616
 
@@ -1770,7 +1799,8 @@
1770
1799
  const find = document.getElementById('find');
1771
1800
  const findCount = document.getElementById('find-count');
1772
1801
  const empty = document.getElementById('find-empty');
1773
- const bar = document.getElementById('section-bar');
1802
+ const trigger = document.getElementById('section-menu');
1803
+ const railName = list.getAttribute('aria-label');
1774
1804
  const drawer = document.getElementById('nav-drawer');
1775
1805
  const drawerBody = document.getElementById('nav-drawer-body');
1776
1806
  const tablet = matchMedia('(max-width: 800px)');
@@ -1884,8 +1914,11 @@
1884
1914
  const row = a.getBoundingClientRect();
1885
1915
  if (row.top < box.top || row.bottom > box.bottom) centre(list, a);
1886
1916
  };
1917
+ // The phone trigger names the rail and its current section, such as "Components: By purpose".
1887
1918
  const mark = (current) => {
1888
1919
  links.forEach((a) => { if (a === current) a.setAttribute('aria-current', 'location'); else a.removeAttribute('aria-current'); });
1920
+ const label = current ? `${railName}: ${current.textContent}` : railName;
1921
+ if (trigger.textContent !== label) trigger.textContent = label;
1889
1922
  keepInView(current);
1890
1923
  };
1891
1924
  const update = () => {
@@ -1935,28 +1968,16 @@
1935
1968
  if (href && href.length > 1) jumpTo(href.slice(1));
1936
1969
  });
1937
1970
 
1938
- // Tablet and phone: one sticky header row holds Find and Menu. The drawer holds Find, the pages, the
1939
- // appearance control, and the rail's groups, in that order. Desktop puts each piece back.
1940
- const pageHead = document.querySelector('.page-head');
1941
- const appearanceRow = document.createElement('div');
1942
- appearanceRow.className = 'drawer-appearance';
1943
- appearanceRow.innerHTML = '<span class="group-label" aria-hidden="true">Appearance</span>';
1944
- const barHome = [bar.parentElement, bar.nextSibling];
1971
+ // Tablet and phone: the rail moves into the drawer, which slides in from the left, the side its trigger
1972
+ // sits on. The pages and the appearance control stay in the header. Desktop puts the rail back.
1945
1973
  const place = () => {
1946
1974
  if (tablet.matches) {
1947
- pageHead.append(bar);
1948
- appearanceRow.append(themeGroup);
1949
- rail.insertBefore(strip, list);
1950
- rail.insertBefore(appearanceRow, list);
1951
1975
  drawerBody.append(rail);
1952
- bar.hidden = false;
1976
+ trigger.hidden = false;
1953
1977
  } else {
1954
1978
  if (drawer.open) drawer.close();
1955
- pageHead.append(strip, themeGroup);
1956
- appearanceRow.remove();
1957
- barHome[0].insertBefore(bar, barHome[1]);
1958
1979
  railHome.prepend(rail);
1959
- bar.hidden = true;
1980
+ trigger.hidden = true;
1960
1981
  }
1961
1982
  };
1962
1983
  tablet.addEventListener('change', () => { place(); rebase(); });
@@ -1969,8 +1990,7 @@
1969
1990
  }
1970
1991
  update();
1971
1992
  // detail is 0 for a click made with Enter or Space, and 1 or more for a tap or a mouse click.
1972
- document.getElementById('section-menu').addEventListener('click', (e) => openDrawer({ byPointer: e.detail > 0 }));
1973
- document.getElementById('section-find').addEventListener('click', () => openDrawer({ toFind: true }));
1993
+ trigger.addEventListener('click', (e) => openDrawer({ byPointer: e.detail > 0 }));
1974
1994
 
1975
1995
  // Copy link: writes the component's URL, announces the result, and shows a tick as Copy does.
1976
1996
  document.querySelectorAll('[data-copy-link]').forEach((button) => button.addEventListener('click', async () => {
@@ -286,10 +286,10 @@ Layer: Core. ui: `UiDialog`.
286
286
 
287
287
  Layer: Core. ui: `UiDrawer`.
288
288
 
289
- - **Anatomy.** A dialog fixed to the left edge, full height, `min(--sidebar + 48px, 100vw - 48px)` wide, with a header (title and close button) and a body that scrolls on its own. It is a floating layer with square corners: `--color-surface-raised`, a transparent 1px border, and `--shadow-dialog`. The close button is a [quiet action](#quiet-action).
290
- - **Navigation drawer.** A drawer that holds navigation opens on the current row, scrolled to the centre of the body. A keyboard open moves focus to that row; a tap moves focus to the body, so no ring shows and no on-screen keyboard opens. An open from a Find button moves focus to the [find field](#find-field), which stays pinned at the top of the body while the list scrolls under it.
289
+ - **Anatomy.** A dialog fixed to the edge its trigger sits on, full height, `min(--sidebar + 48px, 100vw - 48px)` wide, with a header (title and close button) and a body that scrolls on its own. It is a floating layer with square corners: `--color-surface-raised`, a transparent 1px border, and `--shadow-dialog`. The close button is a [quiet action](#quiet-action). The family's navigation triggers sit at the start, so navigation drawers open from the left.
290
+ - **Navigation drawer.** A drawer that holds navigation opens on the current row, scrolled to the centre of the body. A keyboard open moves focus to that row; a tap moves focus to the body, so no ring shows and no on-screen keyboard opens. An open with the `/` shortcut moves focus to the [find field](#find-field), which stays pinned at the top of the body while the list scrolls under it.
291
291
  - **States.** Closed, open, and closing: `data-closing` keeps it open while it slides out.
292
- - **Do.** Use a drawer for navigation or supporting detail that slides in from the side, such as the phone menu, and open it from a named button.
292
+ - **Do.** Use a drawer for navigation or supporting detail that slides in from the side its trigger sits on, such as phone navigation, and open it from a named button.
293
293
  - **Don't.** The page's main task inside a drawer. The drawer holds navigation or detail; the task stays on the page.
294
294
  - **Keyboard and screen reader.** As for the dialog. Following an in-page link inside the drawer closes it and moves focus to the link's destination (given `tabindex="-1"` if it is not focusable), not back to the trigger. Modified clicks (a new tab or window) leave it open.
295
295
  - **Page behind.** While the drawer is open, until it has slid out, the page behind it does not scroll: the root takes `overflow: hidden`, which keeps the reader's position. The page reserves the scrollbar gutter all the time (`scrollbar-gutter: stable` on the root), so hiding a classic scrollbar does not reflow it.
@@ -305,11 +305,11 @@ Layer: Core. The mono font on rail rows is identity. ui: the rows in `UiSiteNav`
305
305
  - **States.** Hover: `--color-row-hover` fill and `--color-text`. Current page (`aria-current="page"`): `--color-nav-current` fill, `--shadow-nav-current`, `--color-nav-current-text`, and medium weight; hover keeps that fill. `--color-nav-current` is an accent tint: `--color-accent` at 14% over `--color-surface-raised` in light, and `--color-accent` at 20% over transparent in dark. `--color-nav-current-text` is the first of `--color-accent`, `--color-text`, black, and white that reaches 4.5:1 over the tinted fill, both on the page and on a surface (composite a translucent fill over each first). Selected tabs and selected list rows use the same fill and rule. Current location in the page (`aria-current="location"`): `--color-text` in medium weight, with a 3×14 `--color-accent` pip at the leading edge, inset 4px, and no fill, in strips and contents lists. In a [section rail](#section-rail) the current section takes the current-page look instead and keeps `aria-current="location"`. A link carries one marker, and page outranks location; the [`aria-current` rules](DESIGN.md#navigation) say which applies, and the [tracking rule](DESIGN.md#navigation) says which section is current. Focus-visible: the focus ring, inset because the rail and the drawer scroll.
306
306
  - **Do.** Label a page link with the destination page's title, and an in-page link with its destination section's heading.
307
307
  - **Don't.** Actions such as Delete or Sign out in a navigation list. Every row is a link to a place; an action is a button.
308
- - **Phone triggers.** Two triggers open a navigation drawer, and each has its place. The site shell uses the header's icon-only Menu button: at tablet width its [section rail](#section-rail) moves into that drawer. A page-level contents drawer, such as a docs page's "On this page", keeps a labelled trigger: a secondary button at `--control-lg` with a three-line menu glyph (14×10, 1.5px lines) before the label. It shows the page's contents and does not act, so it takes the 10px field corner (`--radius-field`), at rest and pressed. The icon-only Menu button stays round. A page with the site shell's Menu does not add a second, labelled trigger. Without JavaScript the list opens in place, so the trigger is a `<details>` summary with the secondary button classes and a chevron after the label. It takes the same 10px field corner. Only the chevron is local.
309
- - **Horizontal strip.** A row of 6 links or fewer; beyond that, use a drawer. It uses these rows and states unchanged: the current page takes the lifted fill, and a location keeps its pip. It scrolls sideways with 2px padding, so the current row's shadow stays whole, and a clipped edge fades over 24px, as [tabs](#tabs) do.
308
+ - **Phone triggers.** One labelled trigger opens a navigation drawer: a secondary button at least `--control-lg` tall, with `--space-2` block padding so a label that wraps grows it, and a three-line menu glyph (14×10, 1.5px lines) `--space-3` before the label. The label names the list and its current row, such as "Components: By purpose" for a [section rail](#section-rail) or "On this page: Install" for a docs page's contents, and follows the current section as the page scrolls. The trigger sits at the start, below the site header, and its drawer opens from the left. It shows the page's contents and does not act, so it takes the 10px field corner (`--radius-field`), at rest and pressed. A page has one trigger: no icon-only Find or Menu button beside it. Without JavaScript the list opens in place, so the trigger is a `<details>` summary with the secondary button classes and a chevron after the label. It takes the same 10px field corner. Only the chevron is local.
309
+ - **Horizontal strip.** A row of 6 links or fewer; beyond that, use a drawer. It uses these rows and states unchanged: the current page takes the lifted fill, and a location keeps its pip. It scrolls sideways with 2px padding, so the current row's shadow stays whole, and a clipped edge fades over 24px, as [tabs](#tabs) do. An edge with 12px or less hidden does not fade. A focused row scrolls into view clear of the fades (`scroll-padding-inline: 24px`), and the strip shows no scrollbar (`scrollbar-width: none`), because the fade shows the overflow. Becoming current changes no row's width: each link carries its label in `data-label`, and a hidden copy of it at the current row's medium weight (`::after`, with empty alternative text and `margin-top: -1lh`, so it shares the label's line) sets the row's width. A strip in a drawer, where labels wrap, drops the copy, and so does a browser without the `lh` unit.
310
310
  - **Keyboard and screen reader.** Plain links in Tab order.
311
311
  - **Motion.** Fill, colour, and shadow change over `--duration-fast` with `--ease-out`.
312
- - **Forced colors.** Fills and shadows drop. The current page (`aria-current="page"`), and a rail's current section, take a 2px `Highlight` border on the leading edge. The location pip keeps its shape with `forced-color-adjust: none` and a `Highlight` fill, so page and location still differ.
312
+ - **Forced colors.** Fills and shadows drop. The current page (`aria-current="page"`), and a rail's current section, take a 2px `Highlight` border on the leading edge, and their leading padding gives up 2px for it, so the row keeps its width. The location pip keeps its shape with `forced-color-adjust: none` and a `Highlight` fill, so page and location still differ.
313
313
  - **List selection.** A selected row in a list or table (`aria-selected="true"`) takes the current-page recipe: `--color-nav-current` fill, `--shadow-nav-current`, medium weight, and its primary text in `--color-nav-current-text`, with no accent bar. Hover keeps that fill. Rows keep their own radius. Dividers between rows are straight 1px `--color-border-subtle` lines inset by the row's inline padding, drawn on the row, not as a shadow, and hidden next to a filled (hovered or selected) row. Forced colors: the fill and shadow drop, and the selected row takes a 2px `Highlight` border on its leading edge, as the current page does.
314
314
 
315
315
  ## Section rail
@@ -320,8 +320,8 @@ Layer: Core. ui: `UiSiteNav`.
320
320
  - **States.** Rows take the navigation list states. The current section keeps `aria-current="location"` but takes the current-page look: `--color-nav-current` fill, `--shadow-nav-current`, and `--color-nav-current-text` in medium weight, with no pip. When the location changes, the rail scrolls its own list, never the page, to centre the current row if it is out of view. It leaves the list alone while the pointer is over the rail or focus is inside it.
321
321
  - **Do.** Use a rail for the sections of a long page, or for a site's pages. A site's pages may take a navigation strip of 6 links or fewer instead.
322
322
  - **Don't.** A rail beside a strip or a contents list that holds the same links. Each level has one list.
323
- - **Tablet and phone.** At `max-width: 800px`, with JavaScript, the page header becomes one sticky row on `--color-bg`: the site name or a back link, then two icon-only secondary buttons at `--control-lg`, Find (a search icon) and Menu (a menu icon). Menu opens a [drawer](#drawer) titled "Menu" that holds, in order, the find field, the site's pages, the appearance control, and the rail's groups. Find opens the same drawer with the field focused. Both buttons set a negative `scroll-margin-top` equal to the page's scroll offset, so focusing one does not scroll the page. Without JavaScript nothing moves: the header keeps its links, and the rail stays in place above `main` with every row shown and the find field hidden.
324
- - **Keyboard and screen reader.** Both buttons have `aria-haspopup="dialog"` and an `aria-label` ("Find a component", "Menu"). Location changes are not announced. The current section follows the [location tracking rule](DESIGN.md#navigation).
323
+ - **Tablet and phone.** At `max-width: 800px`, with JavaScript, the rail moves into a [drawer](#drawer) titled with the rail's name, which holds the find field, pinned at the top, and the rail's groups. The labelled [phone trigger](#navigation-list) below the [site header](#site-header), before the breadcrumb, opens it from the left. Its label is "<rail name>: <current section>", such as "Components: By purpose". The header keeps the site's pages and the appearance control, so the drawer does not repeat them. `/` opens the drawer with the field focused. A page with no rail shows no trigger. Without JavaScript nothing moves: the trigger stays hidden, and the rail stays in place above `main` with every row shown and the find field hidden.
324
+ - **Keyboard and screen reader.** The trigger has `aria-haspopup="dialog"`, and its visible label is its name. Location changes are not announced; the trigger's label changes without an announcement. The current section follows the [location tracking rule](DESIGN.md#navigation).
325
325
  - **Motion.** The rail scrolls its list at once. Rows change as in the navigation list.
326
326
  - **Forced colors.** The current section's fill and shadow drop, and it takes a 2px `Highlight` border on its leading edge, as the current page does.
327
327
 
@@ -343,11 +343,12 @@ Layer: Core. ui: none yet.
343
343
 
344
344
  Layer: Core. ui: none yet.
345
345
 
346
- - **Anatomy.** `<nav aria-label="Breadcrumb">` holding an `<ol>` in `--text-sm`. Separators are a `--color-muted` `/` drawn with `content: "/" / ""`, so they are not read. The crumbs, separators included, centre on the cap height like navigation rows, so they line up with the header strip. Ancestors are `--color-muted` links with no underline, at least `--control-sm` tall (`--control-lg` at tablet width), with `--radius-inline` corners. The current page is plain text with `aria-current="page"`, in `--color-text` and medium weight. On folio sites the trail is mono (identity).
346
+ - **Anatomy.** `<nav aria-label="Breadcrumb">` holding an `<ol>` in `--text-sm`, right above the page's h1. Separators are `--color-muted` chevrons, a 6px box (`0.375rem`) with 1.5px top and right borders turned 45°, so they hold no text to read. The labels centre on the cap height like navigation rows, and the chevrons centre on the row. Ancestors are `--color-muted` links with no underline, at least `--control-sm` tall (`--control-lg` at tablet width), with `--radius-inline` corners. The current page is plain text with `aria-current="page"`, in `--color-text` and medium weight. On folio sites the trail is mono (identity).
347
347
  - **States.** Hover: `--color-text` and an underline. Focus-visible: the focus ring.
348
- - **Do.** Use breadcrumbs only at depth 3 or more, or on a page outside its site's shell.
349
- - **Don't.** A trail whose only crumb repeats the page's h1.
350
- - **Phone.** At `max-width: 640px` only the parent shows, as a back link: "‹ Parent".
348
+ - **Do.** Put the trail above the page's h1 on every page below the site's home page, and keep the project switcher in the header.
349
+ - **Don't.** A trail in the site header in place of the project switcher: the header changes from page to page, and the path reads as the page title.
350
+ - **Placement.** A page-level trail sits on its text, not on its links' boxes: it moves up by half the room the box adds around the line, `calc((1lh - var(--control-sm)) / 2)` (`--control-lg` at tablet width), and takes the same room back below, so the h1 does not move.
351
+ - **Phone.** At `max-width: 640px` a trail of two crumbs shows in full. A trail of three or more shows only the parent, as a back link: the parent's name after a chevron that points back, drawn the same way, inside the link.
351
352
  - **Keyboard and screen reader.** Ancestors are links in Tab order. The current page is text, so it takes no Tab stop.
352
353
  - **Motion.** None: hover changes the colour and underline at once.
353
354
  - **Forced colors.** No change: links and text take the system colours.
@@ -467,10 +468,11 @@ Layer: Identity. ui: `UiCapture`.
467
468
  Layer: Identity. ui: `UiSiteHeader`, `UiSiteAppearancePicker`.
468
469
 
469
470
  - **Anatomy.** A static header at least 64px tall on `--color-bg` with a solid 1px `--color-text` rule below it. At the start is the project switcher: a `<details>` whose summary, a [quiet action](#quiet-action), shows the mono, semibold project name after a `~/` mark in `--color-project` (drawn by CSS, so it is not read), then a chevron. It keeps the quiet-action tint, but it opens a menu and does not act, so it takes the 10px field corner (`--radius-field`), as a select does. Its menu is a floating layer, with the dialog's tokens, listing the shared project registry in the order it defines, as navigation rows with concentric 12px corners (`calc(var(--radius-panel) - var(--space-1))`), with the current project marked `aria-current="page"`. At the end are the site links and the appearance picker: an icon-only segmented control at `lg`. The site links are a [navigation strip](#navigation-list) of rows 44px tall (`--control-lg`). A link to a page inside the site takes `aria-current="page"` on that page, with the current-page recipe.
471
+ - **Position.** Every family site, this design system's site included, starts its header with the project switcher. It is the same on every page: never a breadcrumb or a page title, which go above the page's h1 as [breadcrumbs](#breadcrumbs), and the first breadcrumb is the way back to the site's home page. The links sit at the same x on every page, and the current link is as wide as it is on other pages (see the [horizontal strip](#navigation-list)). A header that puts its links right after the switcher, as this design system's site does, is a grid at `min-width: 801px` (`auto minmax(0, 1fr) auto`), so where the links start never depends on the page.
470
472
  - **States.** The project menu is closed or open; while open, its summary keeps the quiet action's hover tint. Site links take the navigation row states.
471
473
  - **Do.** Keep the same header and site links, six at most and in one order, on every page of a personal product site.
472
474
  - **Don't.** The site header on an application screen. An application keeps its own navigation.
473
- - **Phone.** The first row holds the identity and the picker. With three or more links, the links take a second row. A long identity becomes a [breadcrumb](#breadcrumbs) back link.
475
+ - **Phone.** At `max-width: 800px` the header is static, with `--space-2` above, below, and between its rows. The first row holds the switcher at the start and the picker at the end. Where both do not fit, as at 320px, the picker wraps to its own row at the start; the project name never truncates. With three or more links, the links take the next row, as a strip that scrolls with its fades. Where the strip clips a link, at least 16px of that link stays in view under the fade: on the narrowest phones (a strip 340px wide or less, by container query) the strip's rows take 6px (`0.375rem`) side padding. A page with a [section rail](#section-rail) puts the rail's labelled trigger `--space-2` below the header.
474
476
  - **Keyboard and screen reader.** The summary is named "Project: <name>". Escape closes the menu and returns focus to the summary; moving focus out of it closes it.
475
477
  - **Motion.** The chevron turns 180° while the menu is open, over `--duration-fast` with `--ease-out`. The menu itself opens at once.
476
478
  - **Forced colors.** The rule below the header takes the system text colour, and the menu and the site links follow the navigation list rules.
@@ -20,22 +20,24 @@ Each entry records a choice this language made, the options it rejected, and why
20
20
  | 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 |
21
21
  | 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 |
22
22
  | 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 |
23
- | 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
+ | 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 uses the same trigger below its header (see Phone header). | A down chevron promised a dropdown, but the trigger opens a side drawer. | No test yet |
24
24
  | Shape follows role | Core | A pill acts, or sets a value in place with every option shown, on one line (`--radius-control`); a select, which opens a list, is a one-line non-action control. Small state marks are pills (`--radius-pill`). Places and picked rows are 6px (`--radius-inline`). Typed fields, controls whose label wraps, and one-line controls that are not actions 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" |
25
25
  | Themes | Core | A theme sets only identity inputs: a hue for light and for dark, and optionally its two fonts. Shape, spacing, states, and status colours stay core, so actions are pills in every theme. Every theme passes the contrast guards in both modes. Graphite Indigo is the default; Pine and Mauve (the quiet theme) ship beside it. | The action shape as a theme input (a pill, the 10px field corner, or the 6px row corner): each rounded choice gives actions another role's shape, a select's at 10px and a tab's or row's at 6px, so shape stops telling an action from a field. Radix Themes and shadcn scale every corner together, and Primer, Carbon, Polaris, and Spectrum keep shape core; revisit it as a whole radius scale when a theme needs one. A grey-blue quiet theme (Slate): it sat beside the muted text and the info blue, so its selection read as metadata and its primary button looked disabled. | Per-theme contrast guards (`tests/design-foundations.test.mjs`), the catalogue's rendered recipes in every theme, and the Themes page tests |
26
26
  | 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" |
27
27
  | 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" |
28
- | One-line non-action controls | Core | A one-line control that is not an action takes the 10px field corner (`--radius-field`), as a select does: the select, the project-menu trigger, the labelled contents trigger and its no-JavaScript summary ("On this page"), and the skip link. The project trigger keeps the quiet-action tint. The icon-only Menu button stays round. The owner chose it on 2026-11-10. | The pill (`--radius-control`): a pill means an action, and these controls open a menu or list, pick a value, or move focus. 16px (`--radius-panel`), like the menu and other floating layers: on a one-line control 40 to 44px tall it reads almost as a pill. | 10px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one" |
29
- | 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}" |
28
+ | One-line non-action controls | Core | A one-line control that is not an action takes the 10px field corner (`--radius-field`), as a select does: the select, the project-menu trigger, the labelled contents trigger and its no-JavaScript summary ("On this page"), and the skip link. The project trigger keeps the quiet-action tint. The owner chose it on 2026-11-10. | The pill (`--radius-control`): a pill means an action, and these controls open a menu or list, pick a value, or move focus. 16px (`--radius-panel`), like the menu and other floating layers: on a one-line control 40 to 44px tall it reads almost as a pill. | 10px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one" |
29
+ | 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 centred: `tests/site/site.spec.ts` "a wrapped navigation row or crumb keeps its label inside the fill and focus ring in ${colorScheme}", "the breadcrumb centres its link's ink in ${colorScheme}" |
30
30
  | 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 |
31
31
  | 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" |
32
32
  | 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 |
33
- | 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 |
34
- | 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 |
33
+ | Phone header | Core | The family shell, option A, which the owner chose on 2026-11-11: the site's header matches the other family sites. At tablet width the static header has two rows, the project switcher and the appearance control, then the Pages strip. Where both do not fit, as at 320px, the appearance control wraps to its own row at the start, as UiSiteHeader does on PluginBench and Filip Stack, and the project name never truncates. The rule below the header is the family's solid `--color-text` line. Just below it, at the start, the labelled trigger ("Components: By purpose") opens the drawer from the left, the side it sits on. The drawer is titled with the rail's name and holds Find and the rail's groups. `/` opens it with Find focused. Without JavaScript nothing moves. | The Gate M single sticky row with the site name, then icon-only Find and Menu buttons, with the pages and appearance in the Menu drawer: the site had no way to the other family sites, and the Menu button sat at the right while the drawer slid in from the left. Option B, keeping that row and sliding the drawer in from the right: it kept the site apart from the other seven family sites. Truncating the project name at 320px so both controls shared row 1: the family wraps the picker instead, and the name should never truncate. | `tests/site/site.spec.ts` "the switcher and appearance share the first row, then the pages, then the trigger", "the switcher and appearance take a row each, then the pages, then the trigger", "every clipped strip link shows at least 16px", "the trigger opens the drawer from the left edge, titled with the rail and holding Find and the rail only", "the trigger label follows the current section as the page scrolls"; `tests/catalogue/catalogue.spec.ts` "the trigger opens the drawer on the current row, and a link closes it and focuses the target" |
34
+ | 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 between the page and the drawer, and the pages and appearance stay in the header"; six-link strip limit: no test yet |
35
35
  | 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 |
36
36
  | 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" |
37
37
  | 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 |
38
38
  | 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 |
39
+ | Header that stays still | Core | Option A: the design system's site header is the same on every page. The project switcher `~/ Design system` starts it, as on every family site; the Pages strip follows it, and Appearance, the icon-only segmented control, sits at the end. The first breadcrumb leads back to Overview. Until 2026-11-11 the start was the site name as a link to Overview. At `min-width: 801px` the header is a grid (`auto minmax(0, 1fr) auto`), so the links start at the same x on every page. Each strip link reserves its width at the current row's weight (a hidden `data-label` copy on the label's line), so becoming current moves nothing; under forced colors the current row's padding gives up 2px for its border. A link reached with Tab scrolls clear of the strip's fades. The owner chose it on 2026-11-11. | The flex row that centred the strip between the start item and Appearance: the start item was a breadcrumb that changed width from page to page, so the links started at x=674 on Overview and 451 to 465 elsewhere, and the current link's medium weight added 1–2px. Option B, the strip at the end beside Appearance: the owner chose A. A hidden copy in a 0-height block or a float: the block ended the label's text-box trim, so the label sat 3.4px high, and a float added its width to the label's. | `tests/site/site.spec.ts` "the header links sit at the same x on every page, and the current link keeps its width, with forced colors ${forcedColors}"; `tests/catalogue/catalogue.spec.ts` "a header link reached with Tab scrolls clear of the strip’s faded edges" |
40
+ | Breadcrumb above the title | Core | Every site page but the home page has a breadcrumb right above its h1, and the header keeps the project switcher. Separators, and the phone back mark, are chevrons drawn with two borders of a turned box. The trail sits on its text line, level with the Find field at 1280px, and shows in full on phones when it has two crumbs, as in the approved mock. The owner chose it with header option A on 2026-11-11. | The breadcrumb as the header's start item: it read as the page title and moved the strip. The depth-3 rule it replaces kept trails off a two-level site, which then had only the header to show the way back. A `/` or `‹` glyph with empty alternative text: the owner chose chevrons, and a chevron drawn with borders holds no text in any engine. | `tests/site/site.spec.ts` "the breadcrumb sits above the h1 on every page but Overview, with no separator text", "the breadcrumb lines up with Find, and shows both crumbs on phones" |
39
41
  | 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 |
40
42
  | 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 |
41
43
  | 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" |
@@ -26,7 +26,7 @@
26
26
  :is(.rail, .rail-specimen) a[aria-current="location"]::before { content: none; }
27
27
  /* Fills and shadows drop. The current page and the rail's current section take a system border; a
28
28
  location outside a rail keeps its pip, redrawn in the system highlight. */
29
- @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; } }
29
+ @media (forced-colors: active) { .navlist a[aria-current="page"] { border-inline-start: 2px solid Highlight; padding-inline-start: calc(var(--space-3) - 2px); } .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; padding-inline-start: calc(var(--space-3) - 2px); } }
30
30
  main { min-width: 0; display: grid; gap: var(--space-12); padding-block: var(--space-8) var(--space-16); }
31
31
  section { display: grid; gap: var(--space-4); min-width: 0; }
32
32
  h1, h2 { font-family: var(--font-mono); }
@@ -35,7 +35,7 @@
35
35
  /* Fills and shadows drop. The current page takes a system border; the in-page location keeps
36
36
  its pip, redrawn in the system highlight, so the two still differ. */
37
37
  @media (forced-colors: active) {
38
- .navlist a[aria-current="page"], .nav-current-sample { border-inline-start: 2px solid Highlight; }
38
+ .navlist a[aria-current="page"], .nav-current-sample { border-inline-start: 2px solid Highlight; padding-inline-start: calc(var(--space-3) - 2px); }
39
39
  .navlist a[aria-current="location"]::before, .pip-sample::before { forced-color-adjust: none; background: Highlight; }
40
40
  }
41
41
  .sidebar .navlist a { gap: var(--space-2); }
@@ -388,6 +388,8 @@
388
388
  /* The pip and current-row samples take their state from the navigation row rules above. */
389
389
  .pip-sample { position: relative; display: inline-flex; align-items: center; min-height: var(--row); padding: 0 var(--space-3); font-size: var(--text-sm); }
390
390
  .nav-current-sample { display: inline-flex; align-items: center; min-height: var(--row); padding: 0 var(--space-3); border-radius: var(--radius-inline); font-size: var(--text-sm); }
391
+ /* The sample's padding above resets the forced-colors trade made with the row rules, so it is made again here. */
392
+ @media (forced-colors: active) { .nav-current-sample { padding-inline-start: calc(var(--space-3) - 2px); } }
391
393
  .header-rule { display: block; height: 0; border-top: 1px solid var(--color-text); }
392
394
  .elevation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); padding: var(--space-6); border-radius: var(--radius-panel); background: var(--color-bg); }
393
395
  .elevation > div { display: grid; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius-panel); background: var(--color-surface-raised); font-size: var(--text-sm); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipgutica/design-system",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Filip's design language, tokens, and component catalogue for any framework",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -36,7 +36,7 @@
36
36
  "test:react": "tsc -p tests/react-smoke && playwright test -c tests/react-smoke",
37
37
  "test:catalogue": "tsc -p tests/catalogue && playwright test -c tests/catalogue",
38
38
  "site:build": "node scripts/build-site.mjs",
39
- "test:site": "pnpm site:build && tsc -p tests/site && playwright test -c tests/site",
39
+ "test:site": "node scripts/build-site.mjs --projects tests/fixtures/projects.json && tsc -p tests/site && playwright test -c tests/site",
40
40
  "verify": "pnpm tokens:check && pnpm test && pnpm test:react && pnpm test:catalogue && pnpm test:site && pnpm pack --dry-run && publint"
41
41
  },
42
42
  "engines": {