@filipgutica/design-system 1.0.40 → 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/language/DESIGN.md +2 -2
- package/language/components.md +3 -2
- package/language/decisions.md +1 -0
- package/package.json +1 -1
package/language/DESIGN.md
CHANGED
|
@@ -109,7 +109,7 @@ Controls use quiet depth and familiar shapes: borderless surfaces with one tight
|
|
|
109
109
|
|
|
110
110
|
Use `@media (min-width: 801px)` only for a rule that applies to desktop alone. One documented exception: the tool-home hero splits at `@media (min-width: 1024px)`, with the title across the top, the lede on the left, and the install block and facts on the right. Below 1024px it stacks in source order. Pages add no viewport breakpoint beyond the table and the hero split. A pane that must collapse at its own width uses a container query, as the detail column in `reference.html` does.
|
|
111
111
|
- Density: an application screen has one size for each place, not a range. In an application screen, buttons, fields, and segmented controls are `sm`, `--control-sm` tall (28px), the main action included: it stands out by its primary fill, not its size. Chips stay 24px, their own size. Rows in a table or list, such as the console's monitor list, and rail and navigation rows, are `--row` tall; their body text is `--text-sm` and their metadata `--text-xs`. Documentation and product pages keep the default `md`. At tablet width every touch target grows to `--control-touch`. The console in `reference.html` uses these sizes. This density is control size; how much a screen shows is [Minimal by default](#minimal-by-default).
|
|
112
|
-
- [Navigation](#navigation) is a strip of 6 links or fewer, or a section rail that moves into a drawer at tablet width. A sticky side rail taller than the window scrolls its link list, not the element that draws its divider, so an overlay scrollbar sits clear of the line. Keep wide code, tables, and charts scrolling inside their containers.
|
|
112
|
+
- [Navigation](#navigation) is a strip of 6 links or fewer, or a section rail that moves into a drawer at tablet width. A sticky side rail taller than the window scrolls its link list, not the element that draws its divider, so an overlay scrollbar sits clear of the line. A contents list beside the reading column is sticky, and at tablet width the labelled trigger opens it instead ([Navigation list](components.md#navigation-list)). Keep wide code, tables, and charts scrolling inside their containers.
|
|
113
113
|
- Keep main headings, actions, and product evidence visible on load. Scrolling should reveal more content without being required to make existing content appear.
|
|
114
114
|
|
|
115
115
|
### Surfaces
|
|
@@ -221,7 +221,7 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
|
|
|
221
221
|
| --- | --- | --- | --- |
|
|
222
222
|
| Global | Which site? | Site header and project switcher | `aria-current="page"` on the registry row |
|
|
223
223
|
| Local | Which page of this site? | Section rail, or a navigation strip of 6 links or fewer | `aria-current="page"`: the lifted fill |
|
|
224
|
-
| In-page | Where am I on this page? | Section rail rows that point to `#id` | `aria-current="location"`: the lifted fill in a rail, a pip in strips and contents lists |
|
|
224
|
+
| In-page | Where am I on this page? | Section rail rows, or a contents list's rows, that point to `#id` | `aria-current="location"`: the lifted fill in a rail, a pip in strips and contents lists |
|
|
225
225
|
| Sequential | What comes next? | Pager | `rel="prev"` and `rel="next"` |
|
|
226
226
|
| Path | How do I get back up? | Breadcrumbs above the page title, on every page below the site's home page; never in the header | The current page as text with `aria-current="page"` |
|
|
227
227
|
| Find | Where is X? | Find field that filters the rail | A live match count |
|
package/language/components.md
CHANGED
|
@@ -361,13 +361,14 @@ Layer: Core. The mono font on rail rows is identity.
|
|
|
361
361
|
|
|
362
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.
|
|
363
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.
|
|
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
|
|
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.
|
|
365
365
|
- **Do.** Label a page link with the destination page's title, and an in-page link with its destination section's heading.
|
|
366
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.
|
|
367
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.
|
|
368
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.
|
|
369
370
|
- **Keyboard and screen reader.** Plain links in Tab order.
|
|
370
|
-
- **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.
|
|
371
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.
|
|
372
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.
|
|
373
374
|
|
package/language/decisions.md
CHANGED
|
@@ -62,6 +62,7 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
62
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" |
|
|
63
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" |
|
|
64
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 |
|
|
65
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" |
|
|
66
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" |
|
|
67
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" |
|