@filipgutica/design-system 1.0.7 → 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, the site name link, 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
 
@@ -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. 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.
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); }
@@ -400,9 +403,8 @@
400
403
  /* In a rail the current section takes the current-page look, with no pip. Strips and contents lists keep the pip. */
401
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); }
402
405
  :is(.rail, .rail-specimen) a[aria-current="location"]::before { content: none; }
403
- /* Tablet and phone: Find and Menu, icon-only and square, in the header row. */
404
- .section-bar { display: flex; gap: var(--space-2); }
405
- .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; }
406
408
 
407
409
  /* Find field: a search input with a leading icon and a trailing key hint. */
408
410
  .find { position: relative; display: block; width: 100%; max-width: 260px; }
@@ -677,21 +679,19 @@
677
679
  /* One scroll offset for every in-page jump; sections set no scroll-margin-top. The location tracker reads the same value. */
678
680
  html { scroll-padding-top: var(--space-4); }
679
681
  .frame { width: min(calc(var(--page-max) + var(--sidebar)), calc(100% - var(--space-12))); margin-inline: auto; }
680
- /* Header: the site name, the design system's pages as a navigation strip, and the appearance control.
681
- The site name is the same on every page, in the project-menu trigger's type, with a ~/ mark one
682
- character wide before it. As a link it is a place, so it takes the 6px corner. */
683
- .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); }
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); }
684
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; }
685
687
  .site-name::before { content: "~/" / ""; color: var(--color-accent); }
686
- @media (hover: hover) { a.site-name:hover { text-decoration: underline; text-underline-offset: 0.2em; } }
687
- /* Desktop: the strip starts right after the site name, so its links sit at the same x on every page. */
688
+ /* Desktop: the strip starts right after the identity, so its links sit at the same x on every page. */
688
689
  @media (min-width: 801px) {
689
690
  .page-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--space-8); }
690
691
  .page-head > .strip { justify-self: start; }
691
692
  }
692
- /* Header links are navigation rows at the site header's 44px. The strip's label shows only in the drawer. */
693
+ /* Header links are navigation rows at the site header's 44px. */
693
694
  .page-head .strip a { min-height: var(--control-lg); }
694
- .navlist.strip > .group-label { display: none; }
695
695
  .layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: var(--space-8); }
696
696
  /* One column that may shrink below its content, so a long title or specimen cannot widen the page.
697
697
  A short page, such as one left by a find with no matches, keeps its rows at the top. */
@@ -731,7 +731,8 @@
731
731
  .state > :is(.field, .input, .select, .textarea, .search) { width: 220px; }
732
732
  .state .pager { padding-top: 0; border-top: 0; }
733
733
  .rail-specimen { display: grid; gap: var(--space-3); width: 240px; }
734
- .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; }
735
736
 
736
737
  /* By purpose: each group with its components, in two balanced columns. */
737
738
  .index { display: grid; gap: var(--space-4); }
@@ -753,37 +754,25 @@
753
754
  .coverage td { color: var(--color-accent); }
754
755
  .coverage .none { color: var(--color-muted); }
755
756
 
756
- /* 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. */
757
758
  .drawer .rail { position: static; height: auto; padding: 0; }
758
759
  .drawer .rail-list { overflow: visible; }
759
760
  .drawer .find { max-width: none; }
760
761
  /* The find field stays at the top of the drawer while the list scrolls under it. */
761
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); }
762
- .drawer .navlist.strip { display: grid; overflow: visible; margin-bottom: var(--space-4); padding: 0; }
763
- .drawer .navlist.strip > .group-label { display: block; }
764
- /* A wrapped label and its hidden copy can wrap differently, and the drawer's rows need no reserved width. */
765
- .drawer .navlist.strip a { white-space: normal; }
766
- .drawer .navlist.strip a::after { content: none; }
767
- .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); }
768
- .drawer-appearance > .group-label { padding-inline: var(--space-3); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
769
- .drawer-appearance > .segmented { justify-self: start; max-width: 100%; }
770
763
  /* A tap opens the drawer with focus on its body, which draws no ring; the rows show their own. */
771
764
  #nav-drawer-body:focus { outline: none; }
772
765
 
773
766
  @media (max-width: 800px) {
774
- /* With the script, the header is one sticky row with Find and Menu. --head-inset is its height, and
775
- in-page jumps land below it. */
776
- :root { --head-inset: calc(var(--control-lg) + 2 * var(--space-3) + 1px); }
777
- html { scroll-padding-top: calc(var(--head-inset) + var(--space-4)); }
778
- .page-head { padding-block: var(--space-3); }
779
- .page-head:has(> .section-bar) { position: sticky; top: 0; z-index: 5; flex-wrap: nowrap; background: var(--color-bg); }
780
- /* The site name is a touch target on one line; the bar's Clear gives way to it. */
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); }
781
772
  .page-head > .site-name { min-height: var(--control-lg); white-space: nowrap; }
782
- .page-head:has(> .section-bar) > .site-name { flex: none; }
783
- /* The buttons sit inside the scroll inset, so they cancel it; otherwise focusing one scrolls the page. */
784
- .page-head > .section-bar > * { scroll-margin-top: calc(-1 * (var(--head-inset) + var(--space-4))); }
785
- /* Without the script, the links take a second row and the rail stays in place above the content. */
786
- .page-head .strip { order: 3; flex-basis: 100%; margin-inline: -2px; }
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); }
787
776
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
788
777
  .layout > .rail { position: static; height: auto; padding-block: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
789
778
  .layout > .rail .rail-list { overflow: visible; }
@@ -803,6 +792,11 @@
803
792
  .intro > .crumbs > ol { margin-block: calc((1lh - var(--control-lg)) / 2) calc((var(--control-lg) - 1lh) / 2); }
804
793
  .folio-display { font-size: var(--text-display-sm); }
805
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
+ }
806
800
  @media (max-width: 640px) {
807
801
  /* Phones: a dialog becomes a bottom sheet with rounded top corners. */
808
802
  dialog.dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
@@ -845,6 +839,9 @@
845
839
  <symbol id="i-menu" viewBox="0 0 16 16"><path d="M1.5 3.5h13M1.5 8h13M1.5 12.5h13"/></symbol>
846
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>
847
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>
848
845
  </svg>
849
846
 
850
847
  <a class="skip" href="#main">Skip to content</a>
@@ -852,19 +849,16 @@
852
849
  <div class="frame">
853
850
  <header class="page-head">
854
851
  <p class="site-name">Design system</p>
855
- <nav class="navlist strip" aria-label="Pages"><span class="group-label" aria-hidden="true">Pages</span><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>
856
- <div class="segmented" role="group" aria-label="Appearance" data-live hidden>
857
- <button type="button" data-theme-choice="system" aria-pressed="true">System</button>
858
- <button type="button" data-theme-choice="light" aria-pressed="false">Light</button>
859
- <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>
860
857
  </div>
861
858
  </header>
862
859
 
863
- <!-- Phones: the script moves this bar into the header row, and the rail into the menu drawer. -->
864
- <div class="section-bar" id="section-bar" hidden>
865
- <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>
866
- <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>
867
- </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>
868
862
 
869
863
  <div class="layout">
870
864
  <aside class="rail" id="rail" aria-label="Contents">
@@ -1283,7 +1277,7 @@
1283
1277
  <section class="component" id="drawer" data-layer="Core" aria-labelledby="drawer-title">
1284
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>
1285
1279
  <p class="purpose">A side panel, such as phone navigation.</p>
1286
- <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>
1287
1281
  <div class="row"><h4>Live</h4><div class="states">
1288
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>
1289
1283
  </div></div>
@@ -1306,9 +1300,8 @@
1306
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>
1307
1301
  </div></div>
1308
1302
  <div class="row"><h4>Drawer triggers</h4><div class="states">
1309
- <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>
1310
- <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>
1311
- <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>
1312
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>
1313
1306
  </div></div>
1314
1307
  <div class="row"><h4>List selection</h4><div class="states">
@@ -1326,7 +1319,7 @@
1326
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>
1327
1320
  </div></div>
1328
1321
  <div class="row"><h4>Phone header</h4><div class="states">
1329
- <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>
1330
1323
  </div></div>
1331
1324
  </section>
1332
1325
 
@@ -1345,7 +1338,7 @@
1345
1338
  <section class="component" id="breadcrumbs" data-layer="Core" aria-labelledby="breadcrumbs-title">
1346
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>
1347
1340
  <p class="purpose">The path from the site to this page.</p>
1348
- <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 site name in the header.</dd><dt>Don’t</dt><dd>A trail in the site header in place of the site name: the header changes from page to page, and the path reads as the page title.</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>
1349
1342
  <div class="row"><h4>Trail</h4><div class="states">
1350
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>
1351
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>
@@ -1456,7 +1449,7 @@
1456
1449
  <div class="state wide"><div class="site-header">
1457
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>
1458
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>
1459
- <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>
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>
1460
1453
  </div>
1461
1454
  </div><span class="caption">Live: the project switcher opens, and Docs is the current page; the picker is a sample</span></div>
1462
1455
  </div></div>
@@ -1534,7 +1527,7 @@
1534
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>
1535
1528
  </dialog>
1536
1529
  <dialog class="drawer" id="nav-drawer" aria-labelledby="nav-drawer-title">
1537
- <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>
1538
1531
  <div class="drawer-body" id="nav-drawer-body"></div>
1539
1532
  </dialog>
1540
1533
 
@@ -1806,7 +1799,8 @@
1806
1799
  const find = document.getElementById('find');
1807
1800
  const findCount = document.getElementById('find-count');
1808
1801
  const empty = document.getElementById('find-empty');
1809
- const bar = document.getElementById('section-bar');
1802
+ const trigger = document.getElementById('section-menu');
1803
+ const railName = list.getAttribute('aria-label');
1810
1804
  const drawer = document.getElementById('nav-drawer');
1811
1805
  const drawerBody = document.getElementById('nav-drawer-body');
1812
1806
  const tablet = matchMedia('(max-width: 800px)');
@@ -1920,8 +1914,11 @@
1920
1914
  const row = a.getBoundingClientRect();
1921
1915
  if (row.top < box.top || row.bottom > box.bottom) centre(list, a);
1922
1916
  };
1917
+ // The phone trigger names the rail and its current section, such as "Components: By purpose".
1923
1918
  const mark = (current) => {
1924
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;
1925
1922
  keepInView(current);
1926
1923
  };
1927
1924
  const update = () => {
@@ -1971,28 +1968,16 @@
1971
1968
  if (href && href.length > 1) jumpTo(href.slice(1));
1972
1969
  });
1973
1970
 
1974
- // Tablet and phone: one sticky header row holds Find and Menu. The drawer holds Find, the pages, the
1975
- // appearance control, and the rail's groups, in that order. Desktop puts each piece back.
1976
- const pageHead = document.querySelector('.page-head');
1977
- const appearanceRow = document.createElement('div');
1978
- appearanceRow.className = 'drawer-appearance';
1979
- appearanceRow.innerHTML = '<span class="group-label" aria-hidden="true">Appearance</span>';
1980
- 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.
1981
1973
  const place = () => {
1982
1974
  if (tablet.matches) {
1983
- pageHead.append(bar);
1984
- appearanceRow.append(themeGroup);
1985
- rail.insertBefore(strip, list);
1986
- rail.insertBefore(appearanceRow, list);
1987
1975
  drawerBody.append(rail);
1988
- bar.hidden = false;
1976
+ trigger.hidden = false;
1989
1977
  } else {
1990
1978
  if (drawer.open) drawer.close();
1991
- pageHead.append(strip, themeGroup);
1992
- appearanceRow.remove();
1993
- barHome[0].insertBefore(bar, barHome[1]);
1994
1979
  railHome.prepend(rail);
1995
- bar.hidden = true;
1980
+ trigger.hidden = true;
1996
1981
  }
1997
1982
  };
1998
1983
  tablet.addEventListener('change', () => { place(); rebase(); });
@@ -2005,8 +1990,7 @@
2005
1990
  }
2006
1991
  update();
2007
1992
  // detail is 0 for a click made with Enter or Space, and 1 or more for a tap or a mouse click.
2008
- document.getElementById('section-menu').addEventListener('click', (e) => openDrawer({ byPointer: e.detail > 0 }));
2009
- document.getElementById('section-find').addEventListener('click', () => openDrawer({ toFind: true }));
1993
+ trigger.addEventListener('click', (e) => openDrawer({ byPointer: e.detail > 0 }));
2010
1994
 
2011
1995
  // Copy link: writes the component's URL, announces the result, and shows a tick as Copy does.
2012
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,7 +305,7 @@ 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.
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
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`.
@@ -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, 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
 
@@ -345,8 +345,8 @@ Layer: Core. ui: none yet.
345
345
 
346
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.** Put the trail above the page's h1 on every page below the site's home page, and keep the site name in the header.
349
- - **Don't.** A trail in the site header in place of the site name: the header changes from page to page, and the path reads as the page title.
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
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
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.
352
352
  - **Keyboard and screen reader.** Ancestors are links in Tab order. The current page is text, so it takes no Tab stop.
@@ -468,11 +468,11 @@ Layer: Identity. ui: `UiCapture`.
468
468
  Layer: Identity. ui: `UiSiteHeader`, `UiSiteAppearancePicker`.
469
469
 
470
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.** The identity at the start is the same on every page: never a breadcrumb or a page title, which go above the page's h1 as [breadcrumbs](#breadcrumbs). 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 identity, as this design system's site does with the site name `~/ Design system` linked to its home page (a `--control-sm` row with 6px corners, `--control-lg` at tablet width, underlined on hover), is a grid at `min-width: 801px` (`auto minmax(0, 1fr) auto`), so where the links start never depends on the page.
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.
472
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.
473
473
  - **Do.** Keep the same header and site links, six at most and in one order, on every page of a personal product site.
474
474
  - **Don't.** The site header on an application screen. An application keeps its own navigation.
475
- - **Phone.** The first row holds the identity and the picker. With three or more links, the links take a second row.
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.
476
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.
477
477
  - **Motion.** The chevron turns 180° while the menu is open, over `--duration-fast` with `--ease-out`. The menu itself opens at once.
478
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,24 +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" |
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
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, 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 site name `~/ Design system` (mono, semibold, `~/` in `--color-accent`, as the project-menu trigger) links to Overview; the Pages strip follows it, and Appearance sits at the end. 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 site name. 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
+ | 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" |
41
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 |
42
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 |
43
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" |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipgutica/design-system",
3
- "version": "1.0.7",
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": {