@filipgutica/design-system 1.0.39 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -5
- package/dist/themes/catppuccin.css +5 -5
- package/dist/themes/copper.css +4 -8
- package/dist/themes/fern.css +4 -8
- package/dist/themes/github.css +5 -5
- package/dist/themes/graphite-indigo.css +4 -4
- package/dist/themes/iris.css +4 -8
- package/dist/themes/lagoon.css +4 -8
- package/dist/themes/lapis.css +4 -8
- package/dist/tokens.js +8 -8
- package/dist/tokens.json +8 -8
- package/fonts/SOURCE.json +37 -0
- package/fonts/fonts.css +59 -1
- package/fonts/inter-latin-ext-400-normal.woff2 +0 -0
- package/fonts/inter-latin-ext-500-normal.woff2 +0 -0
- package/fonts/inter-latin-ext-600-normal.woff2 +0 -0
- package/fonts/jetbrains-mono-latin-ext-400-normal.woff2 +0 -0
- package/fonts/jetbrains-mono-latin-ext-500-normal.woff2 +0 -0
- package/fonts/jetbrains-mono-latin-ext-600-normal.woff2 +0 -0
- package/language/DESIGN.md +7 -7
- package/language/components.html +64 -23
- package/language/components.md +29 -10
- package/language/decisions.md +8 -2
- package/language/reference.html +2 -2
- package/language/tokens.css +26 -11
- package/package.json +5 -1
- package/theme-mapper/core.d.ts +2 -0
- package/theme-mapper/core.js +13 -2
- package/theme-mapper/css.d.ts +19 -0
- package/theme-mapper/css.js +151 -0
- package/theme-mapper/engine.js +1 -1
- package/theme-mapper/theme-builder.d.ts +12 -0
- package/theme-mapper/theme-builder.js +36 -0
- package/theme-mapper/theme-file.d.ts +61 -0
- package/theme-mapper/theme-file.js +193 -0
package/language/components.html
CHANGED
|
@@ -351,41 +351,58 @@
|
|
|
351
351
|
.figure figcaption { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-sm); }
|
|
352
352
|
.figure figcaption b { color: var(--color-text); font-weight: var(--weight-medium); }
|
|
353
353
|
|
|
354
|
-
/* Dialog and
|
|
354
|
+
/* Dialog, drawer, and slideout. The catalogue shows them in place; real ones are native dialogs opened with showModal(). */
|
|
355
355
|
.dialog { display: grid; width: min(512px, 100%); max-height: min(672px, calc(100dvh - var(--space-8))); overflow: hidden; padding: 0; border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); }
|
|
356
356
|
/* The component sets display, so a closed native dialog needs its hidden state back. */
|
|
357
357
|
dialog:not([open]) { display: none; }
|
|
358
358
|
dialog.dialog { margin: auto; }
|
|
359
359
|
dialog.dialog::backdrop { background: var(--color-overlay); }
|
|
360
|
-
.dialog-head, .dialog-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); }
|
|
360
|
+
.dialog-head, .dialog-foot, .slideout-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); }
|
|
361
361
|
.dialog-head { border-bottom: 1px solid var(--color-border-subtle); }
|
|
362
362
|
.dialog-head h4 { font-size: 1.125rem; font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
|
|
363
363
|
.dialog-head p { margin-top: var(--space-1); color: var(--color-muted); }
|
|
364
364
|
.dialog-body { min-height: 0; overflow: auto; padding: var(--space-4); }
|
|
365
|
-
.dialog-foot { justify-content: flex-end; gap: var(--space-2); border-top: 1px solid var(--color-border-subtle); background: var(--color-surface); }
|
|
365
|
+
:is(.dialog-foot, .slideout-foot) { justify-content: flex-end; gap: var(--space-2); border-top: 1px solid var(--color-border-subtle); background: var(--color-surface); }
|
|
366
366
|
/* The close button is a quiet action; this sets its size only. */
|
|
367
367
|
.close { flex: none; width: var(--control-md); min-height: var(--control-md); padding: 0; color: var(--color-muted); }
|
|
368
368
|
.drawer { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(calc(var(--sidebar-width) + var(--space-12)), 100%); height: 260px; overflow: hidden; padding: 0; border: 1px solid transparent; background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); }
|
|
369
369
|
dialog.drawer { position: fixed; inset: 0 auto 0 0; height: 100dvh; max-height: none; margin: 0; }
|
|
370
|
-
dialog.drawer::backdrop { background: var(--color-overlay); }
|
|
371
|
-
/*
|
|
370
|
+
dialog:is(.drawer, .slideout)::backdrop { background: var(--color-overlay); }
|
|
371
|
+
/* Slideout: the drawer's layer from the edge the page names, the trailing edge by default, or the top or bottom.
|
|
372
|
+
--slide-from is where it slides from and back to. */
|
|
373
|
+
.slideout { --slide-from: translateX(100%); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(75%, 384px); height: 300px; overflow: hidden; padding: 0; border: 1px solid transparent; background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); }
|
|
374
|
+
.slideout:dir(rtl) { --slide-from: translateX(-100%); }
|
|
375
|
+
dialog.slideout { position: fixed; inset-block: 0; inset-inline: auto 0; height: 100dvh; max-height: none; margin: 0; }
|
|
376
|
+
dialog.slideout:is([data-edge="top"], [data-edge="bottom"]) { inset-inline: 0; width: auto; max-width: none; height: auto; max-height: 75dvh; }
|
|
377
|
+
dialog.slideout[data-edge="top"] { --slide-from: translateY(-100%); inset-block: 0 auto; }
|
|
378
|
+
dialog.slideout[data-edge="bottom"] { --slide-from: translateY(100%); inset-block: auto 0; }
|
|
379
|
+
/* The page behind an open drawer or slideout does not scroll, through the slide out too. Hiding the root's overflow keeps the
|
|
372
380
|
reader's position. The gutter is reserved all the time, so a classic scrollbar that hides does not reflow the page. */
|
|
373
381
|
:root { scrollbar-gutter: stable; }
|
|
374
|
-
:root:has(dialog.drawer[open]) { overflow: hidden; }
|
|
382
|
+
:root:has(dialog:is(.drawer, .slideout)[open]) { overflow: hidden; }
|
|
375
383
|
@media (prefers-reduced-motion: no-preference) {
|
|
376
384
|
dialog.drawer[open] { animation: drawer-in var(--duration) var(--ease-out); }
|
|
377
385
|
dialog.drawer[open]::backdrop { animation: fade-in var(--duration) var(--ease-out); }
|
|
378
386
|
/* The script sets data-closing, waits for the slide out, then closes the dialog. */
|
|
379
387
|
dialog.drawer[data-closing] { animation: drawer-out var(--duration-fast) var(--ease-out) forwards; }
|
|
380
388
|
dialog.drawer[data-closing]::backdrop { animation: fade-out var(--duration-fast) var(--ease-out) forwards; }
|
|
389
|
+
dialog.slideout[open] { animation: slideout-in var(--duration) var(--ease-out); }
|
|
390
|
+
dialog.slideout[open]::backdrop { animation: fade-in var(--duration) var(--ease-out); }
|
|
391
|
+
dialog.slideout[data-closing] { animation: slideout-out var(--duration-fast) var(--ease-out) forwards; }
|
|
392
|
+
dialog.slideout[data-closing]::backdrop { animation: fade-out var(--duration-fast) var(--ease-out) forwards; }
|
|
381
393
|
}
|
|
382
394
|
@keyframes drawer-in { from { transform: translateX(-100%); } }
|
|
383
395
|
@keyframes drawer-out { to { transform: translateX(-100%); } }
|
|
396
|
+
@keyframes slideout-in { from { transform: var(--slide-from); } }
|
|
397
|
+
@keyframes slideout-out { to { transform: var(--slide-from); } }
|
|
398
|
+
/* The specimen's filter group: checkboxes under a field label. */
|
|
399
|
+
.filters { display: grid; gap: var(--space-1); margin: 0; padding: 0; border: 0; }
|
|
400
|
+
.filters legend { margin-bottom: var(--space-1); padding: 0; }
|
|
384
401
|
@keyframes fade-in { from { opacity: 0; } }
|
|
385
402
|
@keyframes fade-out { to { opacity: 0; } }
|
|
386
|
-
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
|
|
387
|
-
.drawer-head h4 { font-size: var(--text-md); font-weight: var(--weight-medium); letter-spacing: 0; }
|
|
388
|
-
.drawer-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--space-4); }
|
|
403
|
+
:is(.drawer-head, .slideout-head) { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
|
|
404
|
+
:is(.drawer-head, .slideout-head) h4 { font-size: var(--text-md); font-weight: var(--weight-medium); letter-spacing: 0; }
|
|
405
|
+
:is(.drawer-body, .slideout-body) { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--space-4); }
|
|
389
406
|
|
|
390
407
|
/* Navigation list */
|
|
391
408
|
.navlist { display: grid; gap: 0.125rem; width: min(100%, 240px); }
|
|
@@ -753,7 +770,7 @@
|
|
|
753
770
|
.projects > summary { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-md); padding-inline: var(--space-3); border-radius: var(--radius-field); font-family: var(--font-mono); font-weight: var(--weight-semibold); list-style: none; user-select: none; }
|
|
754
771
|
.projects > summary::-webkit-details-marker { display: none; }
|
|
755
772
|
/* The ~/ mark is decorative: the empty alternative text keeps it out of the name. */
|
|
756
|
-
.projects > summary::before { content: "~/" / ""; color: var(--color-
|
|
773
|
+
.projects > summary::before { content: "~/" / ""; color: var(--color-accent); }
|
|
757
774
|
/* The open menu keeps the hover tint. :where keeps it below the quiet action's press. */
|
|
758
775
|
:where(.projects[open]) > summary { background: color-mix(in srgb, currentColor 6%, transparent); }
|
|
759
776
|
.projects .icon { transition: transform var(--duration-fast) var(--ease-out); }
|
|
@@ -800,7 +817,7 @@
|
|
|
800
817
|
glow, over the control's own raise or sink. The tokens.css base draws it on links; these rules pin
|
|
801
818
|
it and move it to the visible part of composite controls. */
|
|
802
819
|
:is(.btn, .quiet-action, .check input, .segmented button, .toggle, .crumbs a, .chip, .tool > summary):is(:focus-visible, .is-focus),
|
|
803
|
-
:is(.dialog, .drawer):focus-visible,
|
|
820
|
+
:is(.dialog, .drawer, .slideout):focus-visible,
|
|
804
821
|
.switch:is(:focus-visible, .is-focus) .switch-track,
|
|
805
822
|
.radio-card:has(input:is(:focus-visible, .is-focus)) { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
806
823
|
/* Inside a segmented control, the ring hugs the thumb instead of crossing into the next option. */
|
|
@@ -983,6 +1000,9 @@
|
|
|
983
1000
|
.row { grid-template-columns: minmax(0, 1fr); }
|
|
984
1001
|
/* Touch: controls of every size grow to --control-touch, the inert state examples included. Only the size
|
|
985
1002
|
specimens (data-specimen="size") keep their sizes. */
|
|
1003
|
+
/* tokens.css sets --control-sm, --control-md, and --control-lg to --control-touch here; a size specimen keeps the
|
|
1004
|
+
desktop values, 28px, 32px, and 36px. */
|
|
1005
|
+
[data-specimen="size"] { --control-sm: 1.75rem; --control-md: 2rem; --control-lg: 2.25rem; }
|
|
986
1006
|
.btn:not([data-specimen="size"] *), .navlist a, .rows [role="option"], .tab:not([data-specimen="size"] *) { min-height: var(--control-touch); }
|
|
987
1007
|
/* An icon-only button grows on both sides, so it stays a circle. */
|
|
988
1008
|
.btn[data-icon-only]:not([data-specimen="size"] *) { --size: var(--control-touch); }
|
|
@@ -1017,6 +1037,8 @@
|
|
|
1017
1037
|
@media (max-width: 640px) {
|
|
1018
1038
|
/* Phones: a dialog becomes a bottom sheet with rounded top corners. */
|
|
1019
1039
|
dialog.dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
|
|
1040
|
+
/* The slideout's actions stack in source order, so the primary action, last, sits nearest the thumb. */
|
|
1041
|
+
.slideout-foot { flex-direction: column; align-items: stretch; }
|
|
1020
1042
|
dialog.viewer { max-height: calc(100dvh - var(--space-4)); }
|
|
1021
1043
|
/* A trail of three or more crumbs shows only the parent, as a back link; a two-crumb trail fits in full. */
|
|
1022
1044
|
.crumbs ol:has(> li:nth-child(3)) > li:not(:nth-last-child(2)) { display: none; }
|
|
@@ -1109,7 +1131,7 @@
|
|
|
1109
1131
|
</div>
|
|
1110
1132
|
<div class="navlist" role="group" aria-labelledby="rail-containers">
|
|
1111
1133
|
<span class="group-label" id="rail-containers">Containers and overlays</span>
|
|
1112
|
-
<a href="#surface-and-card" data-terms="surface and card containers and overlays panels and cards for parallel, comparable content. panel box tile">Surface and card</a><a href="#figure" data-terms="figure containers and overlays an image or diagram with a caption. image screenshot caption">Figure</a><a href="#dialog" data-terms="dialog containers and overlays a modal task that needs an answer before the page continues. modal popup sheet confirm">Dialog</a><a href="#drawer" data-terms="drawer containers and overlays a
|
|
1134
|
+
<a href="#surface-and-card" data-terms="surface and card containers and overlays panels and cards for parallel, comparable content. panel box tile">Surface and card</a><a href="#figure" data-terms="figure containers and overlays an image or diagram with a caption. image screenshot caption">Figure</a><a href="#dialog" data-terms="dialog containers and overlays a modal task that needs an answer before the page continues. modal popup sheet confirm">Dialog</a><a href="#drawer" data-terms="drawer containers and overlays navigation in a panel from the leading edge, such as phone navigation. off-canvas sidebar menu">Drawer</a><a href="#slideout" data-terms="slideout containers and overlays a modal panel from an edge for filters and secondary detail. sheet side panel flyout filters">Slideout</a>
|
|
1113
1135
|
</div>
|
|
1114
1136
|
<div class="navlist" role="group" aria-labelledby="rail-navigation">
|
|
1115
1137
|
<span class="group-label" id="rail-navigation">Navigation</span>
|
|
@@ -1152,7 +1174,7 @@
|
|
|
1152
1174
|
<div><h3><a href="#group-selection">Selection</a></h3><ul><li><a href="#checkbox-and-radio">Checkbox and radio</a><span>Pick several options, or one from a short list.</span></li><li><a href="#radio-card-group">Radio card group</a><span>Pick one option that needs a description.</span></li><li><a href="#switch">Switch</a><span>Turn a setting on or off at once.</span></li><li><a href="#toggle-button">Toggle button</a><span>A labelled card that latches on, with a switch inside.</span></li><li><a href="#segmented-control">Segmented control</a><span>Two to five short options that apply at once.</span></li></ul></div>
|
|
1153
1175
|
<div><h3><a href="#group-inputs">Inputs</a></h3><ul><li><a href="#text-input-and-textarea">Text input and textarea</a><span>Type a short value or a longer note.</span></li><li><a href="#select">Select</a><span>Choose from a longer list.</span></li><li><a href="#field-wrapper">Field wrapper</a><span>Label, description, and error text around a field.</span></li><li><a href="#slider">Slider</a><span>Set a value in a range.</span></li></ul></div>
|
|
1154
1176
|
<div><h3><a href="#group-feedback">Feedback and status</a></h3><ul><li><a href="#progress">Progress</a><span>Show how far a task has got.</span></li><li><a href="#score">Score</a><span>Show a value out of a maximum.</span></li><li><a href="#badge">Badge</a><span>A short status label.</span></li><li><a href="#alert">Alert</a><span>A real caveat or status message in the page.</span></li></ul></div>
|
|
1155
|
-
<div><h3><a href="#group-containers">Containers and overlays</a></h3><ul><li><a href="#surface-and-card">Surface and card</a><span>Panels and cards for parallel, comparable content.</span></li><li><a href="#figure">Figure</a><span>An image or diagram with a caption.</span></li><li><a href="#dialog">Dialog</a><span>A modal task that needs an answer before the page continues.</span></li><li><a href="#drawer">Drawer</a><span>
|
|
1177
|
+
<div><h3><a href="#group-containers">Containers and overlays</a></h3><ul><li><a href="#surface-and-card">Surface and card</a><span>Panels and cards for parallel, comparable content.</span></li><li><a href="#figure">Figure</a><span>An image or diagram with a caption.</span></li><li><a href="#dialog">Dialog</a><span>A modal task that needs an answer before the page continues.</span></li><li><a href="#drawer">Drawer</a><span>Navigation in a panel from the leading edge, such as phone navigation.</span></li><li><a href="#slideout">Slideout</a><span>A modal panel from an edge for filters and secondary detail.</span></li></ul></div>
|
|
1156
1178
|
<div><h3><a href="#group-navigation">Navigation</a></h3><ul><li><a href="#navigation-list">Navigation list</a><span>Rows of links with current page and current location.</span></li><li><a href="#section-rail">Section rail</a><span>A sticky list of sections that moves into a drawer on phones.</span></li><li><a href="#find-field">Find field</a><span>Filter a navigation list as you type.</span></li><li><a href="#breadcrumbs">Breadcrumbs</a><span>The path from the site to this page.</span></li><li><a href="#pager">Pager</a><span>Previous and next pages in a sequence.</span></li><li><a href="#tabs">Tabs</a><span>Switch panels about one object, without leaving the page.</span></li><li><a href="#skip-link">Skip link</a><span>Jump past the header to the content.</span></li><li><a href="#keyboard-key">Keyboard key</a><span>Show a key or shortcut in text.</span></li></ul></div>
|
|
1157
1179
|
<div><h3><a href="#group-conversation">Conversation</a></h3><ul><li><a href="#message-row">Message row</a><span>One message: avatar, author, time, and body, with no bubble.</span></li><li><a href="#message-group">Message group</a><span>Consecutive messages by one author under one avatar.</span></li><li><a href="#hover-toolbar">Hover toolbar</a><span>Quick actions on a message, shown on hover or focus.</span></li><li><a href="#thread-panel">Thread panel</a><span>A resizable side pane with a message and its replies.</span></li><li><a href="#composer">Composer</a><span>One growing field with an inline send button.</span></li><li><a href="#tool-call-disclosure">Tool-call disclosure</a><span>A collapsed one-line summary of tool output or a handoff note.</span></li><li><a href="#mention">Mention</a><span>An inline @name in a message.</span></li></ul></div>
|
|
1158
1180
|
<div><h3><a href="#group-code">Code and examples</a></h3><ul><li><a href="#code-block">Code block</a><span>Source code with an optional header and Copy, and a live example above it.</span></li></ul></div>
|
|
@@ -1553,8 +1575,8 @@
|
|
|
1553
1575
|
|
|
1554
1576
|
<section class="component" id="drawer" data-layer="Core" aria-labelledby="drawer-title">
|
|
1555
1577
|
<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>
|
|
1556
|
-
<p class="purpose">
|
|
1557
|
-
<dl class="guidance"><dt>Do</dt><dd>Use a drawer for navigation
|
|
1578
|
+
<p class="purpose">Navigation in a panel from the leading edge, such as phone navigation.</p>
|
|
1579
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a drawer for navigation that does not fit on the page, such as phone navigation or a section rail at tablet width, and open it from a named button.</dd><dt>Don’t</dt><dd>Filters, settings, or detail in a drawer: they go in a slideout. The page’s main task stays on the page.</dd></dl>
|
|
1558
1580
|
<div class="row"><h4>Live</h4><div class="states">
|
|
1559
1581
|
<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>
|
|
1560
1582
|
</div></div>
|
|
@@ -1563,6 +1585,18 @@
|
|
|
1563
1585
|
</div></div>
|
|
1564
1586
|
</section>
|
|
1565
1587
|
|
|
1588
|
+
<section class="component" id="slideout" data-layer="Core" aria-labelledby="slideout-title">
|
|
1589
|
+
<header><h3 id="slideout-title">Slideout</h3><span class="badge">Core</span><a href="components.md#slideout">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="slideout" aria-label="Copy link to Slideout" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1590
|
+
<p class="purpose">A modal panel from an edge for filters and secondary detail.</p>
|
|
1591
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a slideout for filters, settings, or the detail of a selected item that the reader opens beside the page and closes to go on, and open it from a named button, such as Filters.</dd><dt>Don’t</dt><dd>Navigation in a slideout: that is the drawer’s job. The page’s main task stays on the page, and a short task that needs an answer is a dialog.</dd></dl>
|
|
1592
|
+
<div class="row"><h4>Live</h4><div class="states">
|
|
1593
|
+
<div class="state"><button class="btn secondary" type="button" data-open="live-slideout">Filters</button><span class="caption">Opens from the trailing edge</span></div>
|
|
1594
|
+
</div></div>
|
|
1595
|
+
<div class="row"><h4>In place</h4><div class="states">
|
|
1596
|
+
<div class="state wide" inert><div class="slideout" role="dialog" aria-labelledby="so-static-title"><div class="slideout-head"><h4 id="so-static-title">Filters</h4><button class="quiet-action close" type="button" aria-label="Close filters"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></div><div class="slideout-body"><fieldset class="filters"><legend class="field-label">Status</legend><label class="check"><input type="checkbox" checked>Alerting</label><label class="check"><input type="checkbox" checked>Warning</label><label class="check"><input type="checkbox">Healthy</label></fieldset></div><div class="slideout-foot"><button class="btn secondary" type="button">Reset</button><button class="btn" type="button">Apply</button></div></div><span class="caption">Open, pinned: header, body, and footer</span></div>
|
|
1597
|
+
</div></div>
|
|
1598
|
+
</section>
|
|
1599
|
+
|
|
1566
1600
|
<section class="layer-head" id="group-navigation" aria-labelledby="group-navigation-title">
|
|
1567
1601
|
<h2 id="group-navigation-title">Navigation</h2>
|
|
1568
1602
|
<p>Move between pages and sections, and find things.</p>
|
|
@@ -1922,6 +1956,11 @@ I’ll open a ticket for it.</textarea><button class="btn" type="button" data-si
|
|
|
1922
1956
|
<div class="drawer-head"><h4 id="live-drawer-title">Contents</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>
|
|
1923
1957
|
<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>
|
|
1924
1958
|
</dialog>
|
|
1959
|
+
<dialog class="slideout" id="live-slideout" aria-labelledby="live-slideout-title">
|
|
1960
|
+
<div class="slideout-head"><h4 id="live-slideout-title">Filters</h4><form method="dialog"><button class="quiet-action close" type="submit" aria-label="Close filters"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></form></div>
|
|
1961
|
+
<form class="slideout-body" id="live-filters"><fieldset class="filters"><legend class="field-label">Status</legend><label class="check"><input type="checkbox" checked>Alerting</label><label class="check"><input type="checkbox" checked>Warning</label><label class="check"><input type="checkbox">Healthy</label></fieldset></form>
|
|
1962
|
+
<form class="slideout-foot" method="dialog"><button class="btn secondary" type="reset" form="live-filters">Reset</button><button class="btn" type="submit">Apply</button></form>
|
|
1963
|
+
</dialog>
|
|
1925
1964
|
<dialog class="drawer" id="nav-drawer" aria-labelledby="nav-drawer-title">
|
|
1926
1965
|
<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>
|
|
1927
1966
|
<div class="drawer-body" id="nav-drawer-body"></div>
|
|
@@ -2158,17 +2197,19 @@ I’ll open a ticket for it.</textarea><button class="btn" type="button" data-si
|
|
|
2158
2197
|
dialog.addEventListener('click', (e) => { if (pressedOutside && e.target === dialog && outside(e)) close(); });
|
|
2159
2198
|
};
|
|
2160
2199
|
document.querySelectorAll('dialog.dialog').forEach((dialog) => closeOnBackdrop(dialog, () => dialog.close()));
|
|
2161
|
-
//
|
|
2162
|
-
//
|
|
2163
|
-
//
|
|
2164
|
-
|
|
2200
|
+
// Every close path slides a drawer or slideout out first. Under reduced motion there is no animation, so it closes
|
|
2201
|
+
// at once. A slide that is cancelled, such as by turning on reduced motion mid-slide, still closes it.
|
|
2202
|
+
// Following an in-page link closes a drawer, then focus moves to the destination instead of the trigger; a
|
|
2203
|
+
// slideout always returns focus to its trigger.
|
|
2204
|
+
document.querySelectorAll('dialog.drawer, dialog.slideout').forEach((drawer) => {
|
|
2205
|
+
const slide = drawer.classList.contains('drawer') ? 'drawer-out' : 'slideout-out';
|
|
2165
2206
|
let destination = null;
|
|
2166
2207
|
const slideOut = () => {
|
|
2167
2208
|
if ('closing' in drawer.dataset) return;
|
|
2168
2209
|
drawer.dataset.closing = '';
|
|
2169
|
-
if (getComputedStyle(drawer).animationName !==
|
|
2210
|
+
if (getComputedStyle(drawer).animationName !== slide) { drawer.close(); return; }
|
|
2170
2211
|
const finish = (e) => {
|
|
2171
|
-
if (e.target !== drawer || e.pseudoElement || e.animationName !==
|
|
2212
|
+
if (e.target !== drawer || e.pseudoElement || e.animationName !== slide) return;
|
|
2172
2213
|
drawer.removeEventListener('animationend', finish);
|
|
2173
2214
|
drawer.removeEventListener('animationcancel', finish);
|
|
2174
2215
|
drawer.close();
|
|
@@ -2177,9 +2218,9 @@ I’ll open a ticket for it.</textarea><button class="btn" type="button" data-si
|
|
|
2177
2218
|
drawer.addEventListener('animationcancel', finish);
|
|
2178
2219
|
};
|
|
2179
2220
|
drawer.addEventListener('cancel', (e) => { e.preventDefault(); slideOut(); });
|
|
2180
|
-
drawer.
|
|
2221
|
+
drawer.querySelectorAll('form[method="dialog"]').forEach((form) => form.addEventListener('submit', (e) => { e.preventDefault(); slideOut(); }));
|
|
2181
2222
|
closeOnBackdrop(drawer, slideOut);
|
|
2182
|
-
drawer.addEventListener('click', (e) => {
|
|
2223
|
+
if (slide === 'drawer-out') drawer.addEventListener('click', (e) => {
|
|
2183
2224
|
const link = e.target.closest('a[href^="#"]');
|
|
2184
2225
|
if (!link || e.button !== 0 || e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return;
|
|
2185
2226
|
destination = document.getElementById(link.hash.slice(1));
|
package/language/components.md
CHANGED
|
@@ -23,7 +23,7 @@ The sections follow the catalogue's purpose groups, in this order. Each componen
|
|
|
23
23
|
| Selection | Checkbox and radio, radio card group, switch, toggle button, segmented control |
|
|
24
24
|
| Inputs | Text input and textarea, select, field wrapper, slider |
|
|
25
25
|
| Feedback and status | Progress, score, badge, alert |
|
|
26
|
-
| Containers and overlays | Surface and card, figure, dialog, drawer |
|
|
26
|
+
| Containers and overlays | Surface and card, figure, dialog, drawer, slideout |
|
|
27
27
|
| Navigation | Navigation list, section rail, find field, breadcrumbs, pager, tabs, skip link, keyboard key |
|
|
28
28
|
| Conversation | Message row, message group, hover toolbar, thread panel, composer, tool-call disclosure, mention |
|
|
29
29
|
| Code and examples | Code block |
|
|
@@ -33,13 +33,14 @@ A control's **States** line names each interactive state it has. In `components.
|
|
|
33
33
|
|
|
34
34
|
## Rules for every control
|
|
35
35
|
|
|
36
|
-
- **Sizes.** `sm`, `md`, and `lg` use `--control-sm`, `--control-md`, and `--control-lg` for height (28px, 32px, and 36px, Astryx's scale), with `--text-sm`, `--text-md`, and `--text-lg`. A control with no size is `md`. An application screen sets every control at `sm`, its main action included ([density](DESIGN.md#layout-and-spacing)). At tablet width (`max-width: 800px`) controls of every size grow to `--control-touch` (44px)
|
|
36
|
+
- **Sizes.** `sm`, `md`, and `lg` use `--control-sm`, `--control-md`, and `--control-lg` for height (28px, 32px, and 36px, Astryx's scale), with `--text-sm`, `--text-md`, and `--text-lg`. A control with no size is `md`. An application screen sets every control at `sm`, its main action included ([density](DESIGN.md#layout-and-spacing)). At tablet width (`max-width: 800px`) controls of every size grow to `--control-touch` (44px): `tokens.css` sets `--control-sm`, `--control-md`, and `--control-lg` to it there, so a control sized from them needs no touch rule. Only the catalogue's size specimens keep their sizes; each sets the three back on itself.
|
|
37
37
|
- **Borders.** Every control keeps a 1px border, transparent unless its section says otherwise, so forced colors can draw an edge.
|
|
38
38
|
- **Depth.** Each control takes its shadow from the [depth tiers](DESIGN.md#depth).
|
|
39
39
|
- **Hover.** Hover fills apply only where the pointer can hover. Put every `:hover` rule that sets a background, shadow, border colour, or text colour in `@media (hover: hover)`, because a touch screen keeps `:hover` on the last element tapped. The pressed tint stays outside the query: it shows only while a finger is down.
|
|
40
40
|
- **Press.** Only a button has a pressed state; see [Button](#button). A [quiet action](#quiet-action) tints on press without sinking. Other controls have no `:active` treatment: they show their latched state as their section says.
|
|
41
41
|
- **Focus.** One ring for every role but fields: `outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset)` (2px, 3px), with no halo or glow. `--color-focus` is the accent (`--color-accent`), which reaches 3:1 on `--color-bg`, `--color-surface`, and `--color-surface-raised` in both themes. It sits around primary, danger, and selected controls too. Do not give a role its own ring colour; where a variant must recolour the ring, set only `outline-color`. The ring is drawn over the control's own raise or sink shadow, which does not change. It goes on the visible part of a composite control: the switch track, the radio card, and the slider thumb. A terminal capture sets `--color-focus: var(--color-project-dark)`, the dark-theme accent, which reaches 3:1 on the capture in both page themes. In forced colors, a control that opts out of adjustment (a checked box, the switch track) sets `outline-color: CanvasText`; a pressed segmented option, whose inset ring sits on its own `Highlight` fill, sets `HighlightText`. Inside a scrolling or clipping parent, the ring is inset (`outline-offset: calc(var(--focus-width) * -1)`), and a comment names the reason. Only `:focus-visible` shows a ring; pointer hover never does.
|
|
42
42
|
- **Field focus.** Fields (input, select, textarea, and the search wrapper) draw no ring. On `:focus-visible` (the search wrapper uses `:has(input:focus-visible)`) the 1px edge turns `--color-accent`, and `--shadow-field-focus` (`inset 0 0 0 2px`, the accent at 18% over transparent) draws a muted accent line inside it, with `outline: none`. The fill does not change in either theme. An invalid field keeps its `--color-error` edge while focused, and its inset line is `--shadow-field-focus-invalid` (`--color-error` at 18%). Forced colors drop the inset line, so a focused field there draws `outline: var(--focus-width) solid Highlight; outline-offset: -1px`.
|
|
43
|
+
- **Cursor.** An enabled control shows `cursor: pointer`, and so does a label that wraps or follows an enabled checkbox, radio, or switch. The `tokens.css` base sets it with no specificity, so a component's own cursor, such as a busy button's `wait` or a slider's `grabbing`, wins. A label right after an enabled choice counts as that choice's label, so write a choice's label after it or around it. An editable combobox (an `input`, `textarea`, or `contenteditable` one) keeps the text cursor.
|
|
43
44
|
- **Disabled.** Opacity 0.58, `cursor: not-allowed`, and no hover or press. Buttons drop their shadow. Fields drop theirs and fill with the `--color-well` well (the grey well in light; the same as rest in dark). Other controls keep theirs. Use the native `disabled` attribute. A link styled as a button has no disabled state: use `<button disabled>`.
|
|
44
45
|
- **Invalid.** Fields only: `aria-invalid="true"` and a `--color-error` border (not in forced colors; see [field focus](#rules-for-every-control)). Other controls show an invalid state through the [field wrapper](#field-wrapper)'s error text. Link the error text with `aria-describedby` or `aria-errormessage`.
|
|
45
46
|
- **Motion.** Hover and press transitions use `--duration-fast` with `--ease-out`. State changes such as a switch knob use `--duration`. Under `prefers-reduced-motion: reduce`, transitions are instant.
|
|
@@ -308,7 +309,7 @@ Layer: Core.
|
|
|
308
309
|
- **Don't.** A dialog that opens without the reader asking, such as on page load, or one that holds a long form. A long form gets its own page.
|
|
309
310
|
- **Keyboard and screen reader.** `role="dialog"`, `aria-modal="true"`, named by its title. Focus moves in on open and is trapped. Escape closes it, and focus returns to the trigger. A native `<dialog>` opened with `showModal()` provides most of this.
|
|
310
311
|
- **Backdrop.** A tap or click on the backdrop, outside the dialog, closes it, the same way Escape does, and focus returns to the trigger. Only a press that starts outside counts: a drag that starts inside the dialog and ends outside leaves it open. Safari does not support `closedby="any"`, so a script closes it.
|
|
311
|
-
- **Motion.** None: it opens and closes at once. Only the drawer
|
|
312
|
+
- **Motion.** None: it opens and closes at once. Only the drawer and the slideout slide, because they enter from an edge.
|
|
312
313
|
- **Forced colors.** The shadow drops and the transparent border draws as the system edge, so the dialog keeps its outline over the page.
|
|
313
314
|
|
|
314
315
|
### Viewer
|
|
@@ -326,30 +327,48 @@ Layer: Core.
|
|
|
326
327
|
|
|
327
328
|
Layer: Core.
|
|
328
329
|
|
|
329
|
-
- **Anatomy.**
|
|
330
|
-
- **
|
|
330
|
+
- **Anatomy.** Navigation in a dialog fixed to the leading edge (the left in a left-to-right page), full height, `min(--sidebar-width + 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 the drawer opens from the start too.
|
|
331
|
+
- **Current row.** The drawer 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.
|
|
331
332
|
- **States.** Closed, open, and closing: `data-closing` keeps it open while it slides out.
|
|
332
|
-
- **Do.** Use a drawer for navigation
|
|
333
|
-
- **Don't.**
|
|
333
|
+
- **Do.** Use a drawer for navigation that does not fit on the page, such as phone navigation or a section rail at tablet width, and open it from a named button.
|
|
334
|
+
- **Don't.** Filters, settings, or detail in a drawer: they go in a slideout. The page's main task stays on the page.
|
|
334
335
|
- **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.
|
|
335
336
|
- **Backdrop.** A tap or click on the backdrop, outside the drawer, closes it, the same way Escape does, and focus returns to the trigger. Only a press that starts outside counts: a drag that starts inside the drawer and ends outside leaves it open. Safari does not support `closedby="any"`, so a script closes it.
|
|
336
337
|
- **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.
|
|
337
338
|
- **Motion.** It slides in over `--duration` and out over `--duration-fast`, with `--ease-out`, while the overlay fades. Reduced motion shows and hides it at once.
|
|
338
339
|
- **Forced colors.** As for the dialog: the shadow drops and the edge draws in the system colour.
|
|
339
340
|
|
|
341
|
+
## Slideout
|
|
342
|
+
|
|
343
|
+
Layer: Core.
|
|
344
|
+
|
|
345
|
+
- **Anatomy.** A modal panel that slides in from an edge and holds filters or secondary detail. It is the [drawer](#drawer)'s floating layer, with square corners, on the `--color-overlay` backdrop. It has a header (the drawer's title type and a close button, a [quiet action](#quiet-action)), a body that scrolls on its own, and an optional footer on `--color-surface` with its actions at the end, as the [dialog](#dialog)'s footer. Rules between the parts are `--color-border-subtle`.
|
|
346
|
+
- **Edge.** The page names the edge. The default is the trailing edge (the right in a left-to-right page); the top and the bottom are allowed. The leading edge belongs to the navigation drawer. A side slideout is full height and `min(75%, 384px)` wide; a top or bottom slideout is full width and as tall as its content, up to 75% of the dynamic viewport height.
|
|
347
|
+
- **States.** Closed, open, and closing: `data-closing` keeps it open while it slides out.
|
|
348
|
+
- **Do.** Use a slideout for filters, settings, or the detail of a selected item that the reader opens beside the page and closes to go on, and open it from a named button, such as Filters.
|
|
349
|
+
- **Don't.** Navigation in a slideout: that is the drawer's job. The page's main task stays on the page, and a short task that needs an answer is a dialog.
|
|
350
|
+
- **Keyboard and screen reader.** As for the dialog. Every close returns focus to the trigger; a link inside it is not the drawer's in-page exception.
|
|
351
|
+
- **Backdrop.** As for the drawer: a tap or click on the backdrop closes it, the same way Escape does, and a drag that starts inside and ends outside leaves it open.
|
|
352
|
+
- **Page behind.** As for the drawer: the page behind it does not scroll until it has slid out.
|
|
353
|
+
- **Phones.** At `max-width: 640px` the footer's actions stack at full width in source order, so the primary action, last, sits nearest the thumb. A side slideout keeps its 75% width, so the page still shows beside it.
|
|
354
|
+
- **Touch.** At tablet width (`max-width: 800px`) the close button and the footer's actions grow to `--control-touch`, as every control does.
|
|
355
|
+
- **Motion.** As for the drawer, from its own edge: it slides in over `--duration` and out over `--duration-fast`, with `--ease-out`, while the overlay fades. Reduced motion shows and hides it at once.
|
|
356
|
+
- **Forced colors.** As for the dialog: the shadow drops and the edge draws in the system colour.
|
|
357
|
+
|
|
340
358
|
## Navigation list
|
|
341
359
|
|
|
342
360
|
Layer: Core. The mono font on rail rows is identity.
|
|
343
361
|
|
|
344
362
|
- **Anatomy.** A `<nav>` with a name, holding links in rows: at least `--row` tall (`--control-touch` at tablet width), `0 --space-3` padding, `--radius-inline` corners (`calc(var(--radius-panel) - var(--space-1))`, the same 8px, inside a floating menu such as the project menu, so they are concentric with it), `--text-sm`, and `--color-muted`. A row may hold a leading 16px icon and a trailing muted count. A text-only row centres its label on the cap height: where `text-box` is supported, it is a block with `align-content: center`, `--space-2` block padding, and `text-box: trim-both cap alphabetic`, and the location pip centres itself. The padding keeps a wrapped label's first and last lines clear of the fill's edges and the focus ring. Rows with an icon or a count, and browsers without `text-box`, centre the line box, which leaves a label without descenders about 1px above centre. Groups have a `--text-xs` semibold muted label and 2px gaps between rows.
|
|
345
363
|
- **Groups.** Name groups by purpose, with 2 to 8 rows each. Collapse groups only in a list of more than about 40 rows. A collapsible group's label is a `<button aria-expanded>` in the label type, with `--radius-inline` corners and a chevron that turns −90° when the group is closed. Never collapse the group that holds the current row.
|
|
346
|
-
- **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
|
|
364
|
+
- **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, the drawer, and a contents list beside a column scroll.
|
|
347
365
|
- **Do.** Label a page link with the destination page's title, and an in-page link with its destination section's heading.
|
|
348
366
|
- **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.
|
|
367
|
+
- **Beside a column.** A contents list ("On this page") that sits beside the reading column stays in view while the column scrolls. It takes `position: sticky`, a `top` equal to the page's one [scroll offset](DESIGN.md#navigation) (the `html { scroll-padding-top }` length: any sticky bar plus `--space-4`, or `--space-4` alone), and `align-self: start` in its grid or flex row, so the row does not stretch it to the column's height. Its `max-height` is the window height (`100dvh`, as the rail uses) less its `top` and `--space-4`, and it is a column flex layout: its heading stays put, and its list scrolls on its own (`overflow-y: auto`, `overscroll-behavior: contain`) when it does not fit. It keeps the current row in view as the [section rail](#section-rail) does: when the location changes, it scrolls only 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 it or focus is inside it, and centres the current row again when they leave. Its rows, pip, and states do not change. At `max-width: 800px`, where the layout becomes one column, the phone trigger takes its place, as the next part says.
|
|
349
368
|
- **Phone triggers.** One labelled trigger opens a navigation drawer: a secondary button at least `--control-touch` 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 8px 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 8px field corner. Only the chevron is local.
|
|
350
369
|
- **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.
|
|
351
370
|
- **Keyboard and screen reader.** Plain links in Tab order.
|
|
352
|
-
- **Motion.** Fill, colour, and shadow change over `--duration-fast` with `--ease-out`.
|
|
371
|
+
- **Motion.** Fill, colour, and shadow change over `--duration-fast` with `--ease-out`. A contents list beside a column scrolls its list at once, as the rail does.
|
|
353
372
|
- **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.
|
|
354
373
|
- **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.
|
|
355
374
|
|
|
@@ -596,7 +615,7 @@ Layer: Identity.
|
|
|
596
615
|
|
|
597
616
|
Layer: Identity.
|
|
598
617
|
|
|
599
|
-
- **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-
|
|
618
|
+
- **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-accent` (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 8px 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 8px 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 `--control-md` tall (32px), and `--control-touch` at tablet width. A link to a page inside the site takes `aria-current="page"` on that page, with the current-page recipe.
|
|
600
619
|
- **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.
|
|
601
620
|
- **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.
|
|
602
621
|
- **Do.** Keep the same header and site links, six at most and in one order, on every page of a personal product site.
|
package/language/decisions.md
CHANGED
|
@@ -43,6 +43,8 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
43
43
|
| Segmented touch size | Core | At tablet width a segmented control of any size sets `--item` to `--control-touch` (unsized only until 2026-11-23). | 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 |
|
|
44
44
|
| Compact controls | Core | `--control-sm` is 28px (`1.75rem`), Astryx's small element height (`--size-element-sm`). Buttons pad `--space-2` (8px) at `sm` with a 6px icon gap, 10px at `md`, and `--space-3` at `lg`. Badges pad 2px by 6px with a 4px dot gap. A new [chip](components.md#chip) is 24px tall with `--space-2` padding. The owner chose this on 2026-11-22 from a rendered comparison of today's controls, the proposal, and Astryx, after finding the board busy. | Astryx's 12px button padding at every size: the owner asked for narrower controls, and the height cut alone left `sm` buttons as wide as before. Astryx's 12px `sm` label: personal work keeps the shared type family at `--text-sm` (13px). Astryx's solid status badges: status surfaces are soft tints (DESIGN.md, Theme and color), and solid fills are louder than a busy screen can take. Astryx's semibold pressed option: the thumb and accent text already mark it, and a weight change needs a hidden copy of each label to stop the width from shifting. Astryx's 0.98 press scale: the 1px sink is part of quiet depth. | token value: `tests/token-values.test.mjs` "tokens.css preserves DS-1 values except …"; recipes: `tests/catalogue/catalogue.spec.ts` and the ui-sdk parity test `tests/react-smoke/ui-sdk.spec.ts` "ui-sdk parts match the catalogue" |
|
|
45
45
|
| Control size scale | Core | `--control-sm`, `--control-md`, and `--control-lg` are 28px, 32px, and 36px (`1.75rem`, `2rem`, `2.25rem`), Astryx's element sizes (`--size-element-sm`, `-md`, `-lg`). A control with no size is `md`. A separate `--control-touch`, 44px (`2.75rem`), is what controls of every size grow to at tablet width; only the catalogue's inert size specimens and the phone header samples keep their sizes there. On desktop, docs-site header links and quiet actions (Copy, close, Full size, the project trigger) are `--control-md`, and terminal-capture tabs take the tab box. The owner chose this on 2026-11-23: 36px `md` felt big beside 28px `sm`. On 2026-11-24 the owner found the 44px desktop links, tabs, and quiet actions too thick. | The 28 / 36 / 44px scale (until 2026-11-23): `md` sat 8px above `sm`, so a medium control stood out in a dense screen, and `lg` doubled as the touch size. Astryx's 32px `md` and 36px `lg` were first rejected on 2026-11-22 because `md` would move every form and `lg` served touch; the owner's feedback on `md`, and a separate touch token, removed both reasons. Making `sm` the default: documentation and product pages would need `md` on every control, and the gap to `md` is now 4px. Growing only unsized controls at tablet width (the rule before): an application screen sets every control at `sm`, so its touch targets would stay 28px, and an explicit `lg` would drop from 44px to 36px. `--control-touch` for docs-site links and icon actions at every width (2026-11-23 to 2026-11-24): on desktop they stood 12px taller than every 32px control beside them. | token values: `tests/token-values.test.mjs` "tokens.css preserves DS-1 values except …"; rendered sizes and touch growth at 1280, 800, and 375px: `tests/catalogue/catalogue.spec.ts` "<page> renders control sizes at <width>px", `tests/site/site.spec.ts` "links and icon actions keep their sizes and hit areas", and `tests/react-smoke/ui-sdk.spec.ts` "ui-sdk parts match the catalogue at 375px" |
|
|
46
|
+
| Touch sizes in tokens.css | Core | Owner decision, 2026-11-25: `tokens.css` ships the tablet touch rule. At `max-width: 800px` it sets `--control-sm`, `--control-md`, and `--control-lg` to `--control-touch`, so every control sized from them grows with no rule of its own. A size specimen sets the three back on itself. | The rule in each page and library: `DESIGN.md` stated it but no CSS shipped it, so each consumer wrote its own list of touch selectors and missed some. | `tests/catalogue/base.spec.ts` "at 800px, controls of every size are 44, 44, 44px tall"; specimens: `tests/catalogue/catalogue.spec.ts` "components.html renders control sizes at 375px" |
|
|
47
|
+
| Pointer cursor in the base | Core | Owner decision, 2026-11-25: the `tokens.css` base gives enabled buttons, selects, summaries, choice inputs, ranges, file and colour inputs, and the ARIA button, tab, menu item, option, switch, checkbox, radio, and non-editable combobox roles `cursor: pointer`, and so the labels that wrap or follow an enabled choice. It sits in `@layer base` inside `:where()`, so any component cursor wins; disabled controls keep the `not-allowed` their component sets. | A separate opt-in stylesheet: a second import and load order for one rule, while `tokens.css` already ships the base element rules. A rule with specificity: it would outrank a busy button's `wait`. | `tests/catalogue/base.spec.ts` "enabled controls and the labels of enabled choices show the pointer" |
|
|
46
48
|
| Segmented track inset | Core | The track is the control height and insets its options 2px from its outer edge (its 1px border and 1px of padding), with 2px between options, as Astryx's segmented control does (`SegmentedControl.tsx`: 2px padding and gap; `SegmentedControlItem.tsx`: item height the element height minus 4px, 8px padding at `sm`, 12px at `md` and `lg`). Each option is its own thumb, with `calc(var(--radius-control) - var(--inset))`, 6px, measured from the outer edge because the border is part of the track's visible curve: the one control corner below 8px, a named exception to the row corner. The owner asked for it on 2026-11-22 after the 28px `sm` filter's thumb looked off centre in its 30px track. Options set `line-height: normal` after the font shorthand, so the label's line box is its content area and sits centred: the inherited 1.6 put IBM Plex 1.8px above centre in a 24px `sm` option, and `line-height: 1` put Inter 0.5px above centre at `sm` and `md` (Chromium), because its ascent and descent round to an odd total. | A thumb inset 2px inside each full-height option (the rule until 2026-11-22): the track was 2px taller than the control (34px beside a 32px button at `sm`, then 30px beside 28px), and the thumbs sat 4px apart. The mockups' nested 12px track around 8px rows: at 28px tall, a 4px inset leaves a 20px option, which is cramped. Measuring from the padding edge (7px): the visible curve is the border's, so 7px reads as a corner that does not follow the track. | thumb centred and track height equals the same-size button: `tests/catalogue/catalogue.spec.ts`; ui-sdk parity: `tests/react-smoke/ui-sdk.spec.ts` "ui-sdk parts match the catalogue" |
|
|
47
49
|
| Application density | Core | In an application screen, buttons, fields, and segmented controls are `sm` (28px), the main action included, and chips stay 24px. The main action stands out by its primary fill. The owner dropped the `md` main action on 2026-11-23: `md` felt big beside `sm`. Rows are `--row` tall, with `--text-sm` body text and `--text-xs` metadata. Documentation and product pages keep `md`. At tablet width every touch target grows to `--control-touch`, at every size. The owner chose this on 2026-11-22 from the board mockups. | Toolbar controls alone at `sm`, the rule before: forms and actions inside a pane stayed `md`, so one screen mixed two heights. `md` everywhere: the board read as busy. One `md` main action per screen (the first version of this rule): it felt big next to `sm` controls. | No test yet |
|
|
48
50
|
| Tab density | Core | A tab has the button's box: at least `--control-md` (32px) tall, 10px inline padding, no block padding, and line height 1; `data-size="sm"` tabs, for app screens, are 28px with 8px padding. Tabs grow to `--control-touch` at tablet width. The list keeps its 4px padding, which keeps the selected tab's shadow whole where the list clips. The owner asked for narrower tabs with less dead space on 2026-11-24. | The tab before: `--space-2` `--space-3` padding with line height 1.6 made a 38px tab, taller than every control beside it, and 84px wide for "Overview". 2px list padding: it clips the selected tab's `--shadow-nav-current`, which reaches 4px below the tab. | heights: `tests/catalogue/catalogue.spec.ts` "renders control sizes" (tabs at their exact control height) |
|
|
@@ -51,6 +53,7 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
51
53
|
| Conversation components | Core | Message row, message group, hover toolbar, thread panel, composer, tool-call disclosure, mention, and chip are specified here before any app builds them, so the board's React code and any later Vue component draw from one spec. They follow the board mockups (2026-11-22) and Slack, T3 Code, and ChatGPT patterns: flat rows with no bubble; one author's messages within about 5 minutes grouped under one avatar; actions in a hover toolbar that is one Tab stop (`role="toolbar"`, arrow keys between its actions) and never shown on touch; tool output collapsed to one line in a native `<details>`; a composer that is one field with an inline send button; a thread in a side pane, resizable from 20rem to 40rem by drag or arrow keys and full width at tablet width. Conversation sits after Navigation, because its parts reuse the selected row and the overflow menu. A message takes one tag style, `--color-nav-current-text` semibold, only on a message that needs the reader. A mention is static text, not a link. | Bubbles or cards around messages: the board read as busy, and Slack, T3 Code, and ChatGPT use flat rows. A row of buttons on every message: it repeats the same actions down the stream. A toolbar as a `role="group"`: three Tab stops for each message in a long stream. A thread in a dialog: it hides the channel the reader is replying about. Building the components in the board app first: the app's code would become the only definition. | rendered corners by role and the conversation keyboard paths: `tests/catalogue/catalogue.spec.ts`; parts, groups, and states agreement: `tests/component-parts.test.mjs` and `tests/design-foundations.test.mjs` |
|
|
52
54
|
| 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" |
|
|
53
55
|
| 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 |
|
|
56
|
+
| Drawer and slideout | Core | Owner decision, 2026-11-25: two components for two jobs. A drawer holds navigation and opens from the leading edge; a slideout holds filters or secondary detail, opens from the trailing edge by default (the top or bottom when the page names it), is `min(75%, 384px)` wide, and may have a footer whose actions stack on phones. Both share the floating layer, backdrop, page-scroll lock, and slide, and every slideout close returns focus to its trigger. | One drawer for navigation and detail: the owner reads "drawer" as a navigation menu, so a filter panel called a drawer read as the wrong component, and the one spec could not say which edge or width a panel takes. | spec parts: `tests/component-parts.test.mjs` "every component section has every part, or says None with a reason"; edge, width, close, scroll lock, and footer: `tests/catalogue/catalogue.spec.ts` "slideout" |
|
|
54
57
|
| 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 |
|
|
55
58
|
| 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" |
|
|
56
59
|
| 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 |
|
|
@@ -59,6 +62,7 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
59
62
|
| 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" |
|
|
60
63
|
| Header current page | Core | Header links are navigation rows `--control-md` tall (32px), `--control-touch` at tablet width, 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. 44px rows at every width (until 2026-11-24): the owner found them too thick beside the 32px controls. | heights: `tests/site/site.spec.ts` "links and icon actions keep their sizes and hit areas" |
|
|
61
64
|
| 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 |
|
|
65
|
+
| Sticky contents list | Core | Owner decision, 2026-11-25: a contents list ("On this page") beside the reading column is sticky, with `top` at the page's one scroll offset (see One scroll offset) and `align-self: start` in its row, so it stays in view while the column scrolls. It caps at the window height less its `top` and `--space-4`, its list scrolls under a heading that stays put when it does not fit, and it keeps the current row in view as the section rail does, scrolling only its own list. The phone trigger and the list's rows, pip, and states do not change. | A static list that scrolls away with the page: past the first screen the reader loses the contents and the current-section pip. A fixed-position panel: it leaves the layout, so it overlaps content and ignores the column and the frame's edges. | No test yet: no example page has a contents list beside a column |
|
|
62
66
|
| 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" |
|
|
63
67
|
| Focus ring | Core | One accent ring for every role but fields: `outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset)` (2px, 3px), with no glow, over the control's own shadow. Variants recolour it with `outline-color` only. `--color-focus` is `--color-accent`: 6.26:1 on the page, 5.72:1 on a surface, and 6.61:1 on a raised surface in light; 8.31:1, 7.85:1, and 7.39:1 in dark. Commands use the normal code block ring: the accent on `--color-code` (5.72:1 in light and 7.85:1 in dark). Terminal captures use `--color-project-dark`: 8.53:1 on the terminal plate. Inspired by Astryx `focusDefaults` (`utils/focusOutline.stylex.ts`), which writes the width, accent colour, and offset once from tokens. The user chose it from rendered demos and accepted an accent ring around primary, danger, and selected controls. | The neutral ink ring (`--color-focus: var(--color-text)`, offset 2px), the previous choice; the user preferred the accent ring with a 3px gap in rendered demos. Before that, an accent ring on controls and a `--color-link` ring on links, tabs, and navigation rows: two ring hues, cyan around the purple selected tab and current row. A ring in each control's own tone, such as `--color-error` around the danger button: every role needs its own ring rule, and the ring changes colour from control to control. A 2px ring with a 6px accent halo felt jarring, and a 1.5px ring was hard to see; Chromium drew it 1px at 1x. | one accent ring: `tests/design-foundations.test.mjs` "every focus ring is the one accent ring: no per-role ring colour or hand-written ring on any page or in tokens.css"; ring contrast: `tests/design-foundations.test.mjs` "the accent focus ring reaches 3:1 on --color-bg, --color-surface, and --color-surface-raised in both themes" |
|
|
64
68
|
| Page colours outside the base layer | Core | `tokens.css` sets the body background and text colour unlayered; the rest of the base stays in `@layer base`, so component rules still outrank it. | Everything in the layer: a host that wraps the page in its own unlayered reset, such as an artifact viewer, kept its light body while the tokens switched to dark, so token-coloured text sat near-white on white. A note telling each page to restate the body: every delivered page would need to remember it, and the failure only shows in dark mode. | unlayered page colours: `tests/design-foundations.test.mjs` "keeps the page background and text colour outside the base layer, so a host reset cannot win" |
|
|
@@ -77,9 +81,11 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
77
81
|
| Live example stage | Core | The stage sits on the page background (`--color-bg`), not in a well or a panel. It is the named exception to the container depth tier. | A raised or inset stage changes the surface under the preview, so raised controls do not look as they do on a page. | No test yet |
|
|
78
82
|
| Live example source | Core | Inside the frame, the code block drops its own radius, border, and shadow, and spans the frame's width. The frame draws the one edge. | A rounded well with its own edge and shadow inside the frame is a frame inside a frame. | No test yet |
|
|
79
83
|
| Token names | Core | One set of names, the design system's own: `--color-*` for colours, `--shadow-*` for shadows, and `--text-*`, `--radius-*`, and `--font-*` for type sizes, radii, and fonts. See [Token names](#token-names). | Two sets, the [1.x short names](#token-names) here and `--color-*` names in ui: every site and agent translated between them through `ui:` comments, and the 1.x control radius used Tailwind's `-md` name for a 999px pill where Tailwind's is 0.375rem. Short names everywhere: about 920 references in 27 files across six repositories, a ui major release, and 18 new names. | no 1.x names: `tests/token-names.test.mjs` "no payload file uses a 1.x token name" |
|
|
80
|
-
| Default fonts | Core | Owner decision, 2026-11-24: Inter for `--font-ui` and JetBrains Mono for `--font-mono`, the industry-standard pairing. Both are self-hosted from `fonts.css` (latin, 400, 500, and 600, under the OFL), so every operating system renders the same faces. A theme may still set its own two stacks. | IBM Plex Sans and Mono, the faces before: the owner chose the standard pairing. The system font stack: it renders a different face on each operating system, so text metrics and the look differ per reader. Figtree: considered and not chosen. | faces load: `tests/react-smoke/smoke.spec.ts` "the Inter and JetBrains Mono faces load from fonts.css" |
|
|
81
|
-
| Subtree themes | Core | Owner decision, 2026-11-24: `data-theme="dark"` or `"light"` on any element below `<html>`, or a `.dark` class on `<html>` or below it, themes that subtree. The token build generates one block per mode (`.dark` or `[data-theme="dark"]`, and `[data-theme="light"]`, each under `:root`; `data-theme="light"` wins over `.dark` on one element) that redeclares every token that differs between the modes or follows one that does, since a custom property resolves where it is declared. Each theme file adds blocks for what it changes there, such as its
|
|
84
|
+
| Default fonts | Core | Owner decision, 2026-11-24: Inter for `--font-ui` and JetBrains Mono for `--font-mono`, the industry-standard pairing. Both are self-hosted from `fonts.css` (latin and latin-ext, 400, 500, and 600, under the OFL; latin-ext since 2026-11-25, so names such as Łódź or Dvořák keep the face, and a browser fetches it only for a page that uses those characters), so every operating system renders the same faces. A theme may still set its own two stacks. | IBM Plex Sans and Mono, the faces before: the owner chose the standard pairing. The system font stack: it renders a different face on each operating system, so text metrics and the look differ per reader. Figtree: considered and not chosen. | faces load: `tests/react-smoke/smoke.spec.ts` "the Inter and JetBrains Mono faces load from fonts.css" |
|
|
85
|
+
| Subtree themes | Core | Owner decision, 2026-11-24: `data-theme="dark"` or `"light"` on any element below `<html>`, or a `.dark` class on `<html>` or below it, themes that subtree. The token build generates one block per mode (`.dark` or `[data-theme="dark"]`, and `[data-theme="light"]`, each under `:root`; `data-theme="light"` wins over `.dark` on one element) that redeclares every token that differs between the modes or follows one that does, since a custom property resolves where it is declared. Each theme file adds blocks for what it changes there, such as its neutrals. The selectors carry `:root`, so they outrank a bare `:root` input, as the root dark rules do. The subtree takes its mode's text colour from the base layer. On `<html>`, `data-theme` and the system preference work as before; `class="dark"` there is new and forces dark unless `data-theme="light"` is also set. | Changed-value blocks only: the derived tokens (accent mixes, wells, shadows) keep the page's mode. A component library's own `.dark` copy of every dark value: it drifts from the build. Moving the dark switch from `--color-project` to `--color-accent`, so a light subtree needs no hue of its own: it changes what `var(--color-project)` reads in dark on `<html>`. | nested subtrees in every theme: `tests/catalogue/subtree-themes.spec.ts` |
|
|
86
|
+
| Accent switches by mode | Core | Owner decision, 2026-11-25: the theme inputs never change with the mode. `--color-project` is the light hue and `--color-project-dark` the dark hue in every mode, and `tokens.css`'s dark and light blocks switch `--color-accent` between them, so every token that follows the accent computes as before. A hue-only theme is one `:root` rule that works after `tokens.css`, in its cascade layer or a later one. Breaking: `var(--color-project)` in dark, the dark `color-project` in `tokens.json`, and the `--color-project` that `themeVariables()` returns for a dark theme are now the light hue; read `--color-accent` for the hue of the current mode. | The dark blocks reassigning `--color-project` to `var(--color-project-dark)`, and the light subtree block repeating the default literal hue: a theme had to sit in `tokens.css`'s own layer and repeat its hue per mode, or its `:root` rule beat the dark blocks from a later layer and showed the light hue in dark. | every colour token in each placement, mode, and subtree: `tests/catalogue/theme-placement.spec.ts` |
|
|
82
87
|
| Theme inputs list | Core | Owner decision, 2026-11-24: the token build publishes `dist/theme-inputs.json` (`./theme-inputs.json`), the names a theme may set by kind: the hue pair, the text on the hue's fills, the two fonts, the base radius, the neutrals, and the syntax colours. It comes from the engine, so it follows the build. A component library's own test reads it and fails when one of its themes sets any other token, so "theme inputs only, never overrides" is checked here, not by convention. `./theme-mapper` also exports `checkTheme(inputs)`, the shipped themes' contrast checks, for themes this package does not ship. | A hand-kept list in the README: it drifts from the engine. A list in each component library: each copy drifts, and none follows a new input. | list and shipped themes: `tests/theme-inputs.test.mjs` "every shipped theme file sets only theme inputs", "the theme mapper sets only theme inputs" |
|
|
88
|
+
| Theme builder entry | Core | Owner decision, 2026-11-25: `./theme-builder` exports `themeCss(file)` and `parseTheme(file)`, the code the token build writes `themes/*.css` with, so a consumer turns its own theme file into CSS without copying `tokens.css`'s selectors. A theme file may also set the text on the hue (`color-accent-text`, `color-nav-current-text`, `color-segmented-current-text`) per mode, and the README documents the format, `radius-base` included. | Each consumer generating its theme CSS from the selectors in `tokens.css`: every copy drifts when the build changes them, as the subtree blocks did. A builder in `scripts/` only: it reads the file system and is not in the package. | `tests/theme-files.test.mjs` "the theme-builder entry writes each shipped theme file as the build does", "a theme file may set the text on the hue per mode, as srgb colours" |
|
|
83
89
|
| Sidebar width name | Core | Owner decision, 2026-11-24: the sidebar width is `--sidebar-width` (224px). A breaking rename of `--sidebar`. | `--sidebar`: shadcn-based apps define `--sidebar` as a colour, so a page that loads both breaks one of them. | DS-1 parity under the rename: `tests/token-values.test.mjs` "tokens.css keeps the DS-1 declarations except the inherited command aliases" |
|
|
84
90
|
| Versioning | Core | Releases are 1.0.x patches while the system has no outside users, tagged `ds-v*` from the `ds-v1.0.0` seed. Every release, a breaking one included, is a patch; the release notes name a breaking change written as `!` or a `BREAKING CHANGE:` footer in the commit message. npm already holds 1.1.0 through 2.4.0 from the earlier `v*` series, so leaving 1.0.x means 2.5.0 or 3.0.0. | Semver majors and minors (2.x): the numbers signalled a maturity the system does not have yet. 0.0.x: npm already holds 1.0.0, and a `^0.0.1` range matches only 0.0.1. | patch cap: `tests/release.test.mjs` "the release analyzer caps feat, fix, and breaking changes, from a commit or a PR body, at a patch", "the release analyzer releases nothing for chore-only commits"; tag series: `tests/release.test.mjs` "the site version comes from the latest ds-v tag and ignores the earlier v tags" |
|
|
85
91
|
| Agent delivery | Core | A Claude and Codex plugin whose root is this repository. Its `design-system` skill reads `language/` in place, and each release stamps its version into the plugin manifests and commits them back, since both hosts cache a plugin by version. A `docs` commit releases a patch, because agents read `language/` as instructions. | filip-stack host config copying the pinned package to `~/design-system`: it tied the design system to filip-stack and needed its own installer. A plugin folder holding a copy of `language/`: plugin caches cannot reach outside the plugin folder, so the copy would need a build step and a staleness check. | skill path: `tests/plugin.test.mjs` "the design-system skill names a DESIGN.md that exists in the plugin"; version stamp: `tests/plugin.test.mjs` "a release stamps its version into every plugin manifest and keeps the other fields"; docs release: `tests/release.test.mjs` "the release analyzer releases a patch for a docs commit, since agents read language/ through the plugin" |
|
package/language/reference.html
CHANGED
|
@@ -638,8 +638,8 @@
|
|
|
638
638
|
|
|
639
639
|
<h4>Identity, links, and focus</h4>
|
|
640
640
|
<ul class="swatches">
|
|
641
|
-
<li class="swatch" data-token="--color-project"
|
|
642
|
-
<li class="swatch" data-token="--color-project-dark" data-on="--color-terminal" data-min="3"><i class="chip" aria-hidden="true"></i><code>--color-project-dark</code><span class="value"></span><span class="ratio"></span><span class="use">The dark-theme hue and the terminal capture accent</span></li>
|
|
641
|
+
<li class="swatch" data-token="--color-project"><i class="chip" aria-hidden="true"></i><code>--color-project</code><span class="value"></span><span class="use">The light-theme hue; <code>--color-accent</code> takes it in light</span></li>
|
|
642
|
+
<li class="swatch" data-token="--color-project-dark" data-on="--color-terminal" data-min="3"><i class="chip" aria-hidden="true"></i><code>--color-project-dark</code><span class="value"></span><span class="ratio"></span><span class="use">The dark-theme hue, which <code>--color-accent</code> takes in dark, and the terminal capture accent</span></li>
|
|
643
643
|
<li class="swatch" data-token="--color-accent" data-on="--color-bg --color-surface-raised --color-code" data-min="3"><i class="chip" aria-hidden="true"></i><code>--color-accent</code><span class="value"></span><span class="ratio"></span><span class="use">Primary action fill, marks, current items, checked controls; 4.5:1 where it colors text</span></li>
|
|
644
644
|
<li class="swatch" data-token="--color-accent-text" data-on="--color-accent --color-button-hover" data-min="4.5"><i class="chip" aria-hidden="true"></i><code>--color-accent-text</code><span class="value"></span><span class="ratio"></span><span class="use">Primary button label</span></li>
|
|
645
645
|
<li class="swatch" data-token="--color-button-hover" data-fg="var(--color-accent-text)" data-on="--color-button-hover" data-min="4.5"><i class="chip" aria-hidden="true"></i><code>--color-button-hover</code><span class="value"></span><span class="ratio"></span><span class="use">Primary button hover</span></li>
|