@codenhub/styles 0.1.0 → 0.1.1

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.
Files changed (45) hide show
  1. package/README.md +7 -69
  2. package/dist/aesthetics/chunky-tile.css +1 -1
  3. package/dist/aesthetics/index.css +1 -1
  4. package/dist/components.css +1 -1
  5. package/dist/index.css +1 -1
  6. package/dist/native.css +1 -1
  7. package/dist/theme.css +1 -1
  8. package/dist/tw/aesthetics/chunky-tile.css +4 -2
  9. package/dist/tw/box.css +21 -0
  10. package/dist/tw/components/button.css +23 -3
  11. package/dist/tw/components/form.css +0 -2
  12. package/dist/tw/components/index.css +16 -6
  13. package/dist/tw/components/surface.css +29 -5
  14. package/dist/tw/elevation.css +14 -7
  15. package/dist/tw/index.css +20 -5
  16. package/dist/tw/intent.css +20 -0
  17. package/dist/tw/native.css +4 -20
  18. package/dist/tw/reset.css +20 -33
  19. package/dist/tw/theme.css +12 -7
  20. package/dist/tw/utilities/content.css +14 -2
  21. package/docs/accessibility.md +58 -48
  22. package/docs/changelog/0.1.0.md +37 -0
  23. package/docs/changelog/0.1.1.md +10 -0
  24. package/docs/changelog/index.md +10 -0
  25. package/docs/concepts.md +20 -46
  26. package/docs/index.md +18 -45
  27. package/docs/integrating/astro.md +13 -7
  28. package/docs/integrating/index.md +25 -16
  29. package/docs/integrating/nextjs.md +31 -8
  30. package/docs/integrating/svelte.md +14 -8
  31. package/docs/integrating/tailwind.md +31 -15
  32. package/docs/integrating/vue.md +13 -7
  33. package/docs/setup.md +35 -55
  34. package/docs/usage/aesthetics.md +30 -107
  35. package/docs/usage/buttons.md +19 -35
  36. package/docs/usage/composing.md +25 -100
  37. package/docs/usage/content-and-layout.md +56 -81
  38. package/docs/usage/customizing.md +25 -90
  39. package/docs/usage/feedback.md +11 -49
  40. package/docs/usage/forms.md +16 -58
  41. package/docs/usage/index.md +9 -17
  42. package/docs/usage/theming.md +25 -81
  43. package/docs/usage/tooltips.md +15 -21
  44. package/llms-full.txt +1060 -1506
  45. package/package.json +121 -44
@@ -1,13 +1,12 @@
1
1
  ---
2
2
  title: Composing
3
3
  description: Combining intent, presentation, and aesthetic on a component, and the axis-support matrix.
4
+ order: 1
4
5
  ---
5
6
 
6
7
  # Composing the three axes
7
8
 
8
- See [Concepts](../concepts.md#the-three-axes) for what each axis means. This
9
- page covers how they combine in markup, what the presentation classes mean in
10
- depth, which components support which axis, and elevation.
9
+ See [Concepts](../concepts.md#the-three-axes) for what each axis means. This page covers how they combine in markup, what the presentation classes mean in depth, which components support which axis, and elevation.
11
10
 
12
11
  ## Combining axes
13
12
 
@@ -19,25 +18,13 @@ depth, which components support which axis, and elevation.
19
18
  </div>
20
19
  ```
21
20
 
22
- A declaration on the element always beats one inherited from a container, so
23
- a container sets the default look for its subtree and any element opts out.
21
+ A declaration on the element always beats one inherited from a container, so a container sets the default look for its subtree and any element opts out.
24
22
 
25
- Intent classes do not cascade. `.primary` and its siblings stay on the
26
- element that shows the intent, because a container silently recoloring every
27
- descendant is a trap rather than a feature — see
28
- [Theming → Intent tokens](./theming.md#intent-tokens). Use `.neutral` to opt
29
- an element back out of an inherited intent context. Presentation and
30
- [material tokens](./customizing.md#material-tokens) do cascade, so a
31
- container can set the look of its whole subtree while any element overrides
32
- it.
23
+ Intent classes do not cascade. `.primary` and its siblings stay on the element that shows the intent, because a container silently recoloring every descendant is a trap rather than a feature — see [Theming → Intent tokens](./theming.md#intent-tokens). Use `.neutral` to opt an element back out of an inherited intent context. Presentation and [material tokens](./customizing.md#material-tokens) do cascade, so a container can set the look of its whole subtree while any element overrides it.
33
24
 
34
25
  ## Presentation
35
26
 
36
- Presentation has two independent axes. `.solid`, `.soft`, and `.ghost`
37
- decide how much intent fills a component; `.edged` and `.edgeless` decide
38
- whether it draws a boundary. They set
39
- [presentation tokens](./customizing.md#presentation-tokens) and nothing
40
- else, so they work on the component itself or on any ancestor.
27
+ Presentation has two independent axes. `.solid`, `.soft`, and `.ghost` decide how much intent fills a component; `.edged` and `.edgeless` decide whether it draws a boundary. They set [presentation tokens](./customizing.md#presentation-tokens) and nothing else, so they work on the component itself or on any ancestor.
41
28
 
42
29
  | Class | Look |
43
30
  | ----------- | ---------------------------------------------------------- |
@@ -68,21 +55,11 @@ The combinations mean exactly what they spell:
68
55
  <!-- A field sunk into the page -->
69
56
  ```
70
57
 
71
- A fill class never decides an edge and an edge class never decides a fill.
72
- Use `.solid.edgeless` for a filled box with no line — and prefer it on a
73
- neutral one, because a capped fill leaves the box translucent and the edge
74
- blend then paints a second coat of the same tint rather than disappearing
75
- into it (measured 1.53:1 against its own plate in light, 1.82:1 in dark).
58
+ A fill class never decides an edge and an edge class never decides a fill. Use `.solid.edgeless` for a filled box with no line — and prefer it on a neutral one, because a capped fill leaves the box translucent and the edge blend then paints a second coat of the same tint rather than disappearing into it (measured 1.53:1 against its own plate in light, 1.82:1 in dark).
76
59
 
77
- The edge is the silhouette and nothing else. Rules _inside_ a component that
78
- has an inside are a separate switch — see
79
- [Content and layout → Table rules](./content-and-layout.md#table-rules) —
80
- because tying them to this axis made them arrive by implication rather than
81
- by request.
60
+ The edge is the silhouette and nothing else. Rules _inside_ a component that has an inside are a separate switch — see [Content and layout → Table rules](./content-and-layout.md#table-rules) — because tying them to this axis made them arrive by implication rather than by request.
82
61
 
83
- With no presentation class in scope, each component keeps its own default:
84
- buttons are filled, alerts and badges are tinted, surfaces and controls are
85
- neutral and bordered.
62
+ With no presentation class in scope, each component keeps its own default: buttons are filled, alerts and badges are tinted, surfaces and controls are neutral and bordered.
86
63
 
87
64
  | Component | Reads |
88
65
  | ----------------------------------------------- | ------------------------------------------- |
@@ -97,12 +74,7 @@ neutral and bordered.
97
74
  | `.code`, `.pre`, `.tooltip` | Fill, text, border, and material. |
98
75
  | `.loader`, `.skeleton`, `.progress`, `.divider` | Intent only, not presentation. |
99
76
 
100
- Text controls and toggles cap a **cascaded** fill at `6%`, keeping typed
101
- text legible when a `.solid` container reaches a field nobody classed. A
102
- fill class written on the control itself names its own cap instead, because
103
- that is a consumer describing what they want: `.soft` takes `12%` and
104
- `.solid` takes `20%`. A switch caps at `40%`, where its three fills separate
105
- far enough to read on a track.
77
+ Text controls and toggles cap a **cascaded** fill at `6%`, keeping typed text legible when a `.solid` container reaches a field nobody classed. A fill class written on the control itself names its own cap instead, because that is a consumer describing what they want: `.soft` takes `12%` and `.solid` takes `20%`. A switch caps at `40%`, where its three fills separate far enough to read on a track.
106
78
 
107
79
  | On a text control | fill |
108
80
  | ----------------- | ---- |
@@ -111,45 +83,19 @@ far enough to read on a track.
111
83
  | `.soft` | 12% |
112
84
  | `.solid` | 20% |
113
85
 
114
- The same split governs the edge: a cascaded `.edgeless` is floored and the
115
- element's own is honoured — except on `.checkbox` and `.radio`, which never
116
- drop their line at all. See [Forms](./forms.md) for the full toggle and text
117
- control reference.
118
-
119
- A tooltip bubble is filled, over a tinted ground. An intent fills it with
120
- that intent's own color: `.tooltip.primary` is the primary color, black on a
121
- light page and white on a dark one, and `.tooltip.destructive` is a red
122
- bubble.
123
-
124
- With no intent the bubble is `--color-tooltip`, the one plate in the package
125
- chosen per theme rather than derived from an intent. Composed like
126
- everything else it was `20%` of the page's ink over the surface tone, which
127
- steps _lighter_ than the surface on a dark page and _darker_ on a light
128
- one — so the dark bubble read as lifted and the light one as a mid-grey
129
- slab two steps darker than every card on the screen. The token states each
130
- direction instead: near-white over a light page, a mid grey over a dark
131
- one. `--color-tooltip-contrast` is its ink.
132
-
133
- Near-white is only 1.04:1 against a light page, so the bubble draws a
134
- hairline as well, and floors it: a container's `.solid` or `.edgeless`
135
- cannot take the boundary away from a bubble nobody classed, while
136
- `.tooltip.edgeless` still can. The ground keeps the bubble opaque at every
137
- fill, so a cascaded presentation leaves it readable over whatever it floats
138
- above. It reads the material tokens too, so an [aesthetic](./aesthetics.md)
139
- in scope shapes the bubble like any other component. See
140
- [Tooltips](./tooltips.md) for the full tooltip reference.
86
+ The same split governs the edge: a cascaded `.edgeless` is floored and the element's own is honoured — except on `.checkbox` and `.radio`, which never drop their line at all. See [Forms](./forms.md) for the full toggle and text control reference.
87
+
88
+ A tooltip bubble is filled, over a tinted ground. An intent fills it with that intent's own color: `.tooltip.primary` is the primary color, black on a light page and white on a dark one, and `.tooltip.destructive` is a red bubble.
89
+
90
+ With no intent the bubble is `--color-tooltip`, the one plate in the package chosen per theme rather than derived from an intent. Composed like everything else it was `20%` of the page's ink over the surface tone, which steps _lighter_ than the surface on a dark page and _darker_ on a light one — so the dark bubble read as lifted and the light one as a mid-grey slab two steps darker than every card on the screen. The token states each direction instead: near-white over a light page, a mid grey over a dark one. `--color-tooltip-contrast` is its ink.
91
+
92
+ Near-white is only 1.04:1 against a light page, so the bubble draws a hairline as well, and floors it: a container's `.solid` or `.edgeless` cannot take the boundary away from a bubble nobody classed, while `.tooltip.edgeless` still can. The ground keeps the bubble opaque at every fill, so a cascaded presentation leaves it readable over whatever it floats above. It reads the material tokens too, so an [aesthetic](./aesthetics.md) in scope shapes the bubble like any other component. See [Tooltips](./tooltips.md) for the full tooltip reference.
141
93
 
142
94
  ## Component axis reference
143
95
 
144
- This table is the authoritative axis map for demonstrated components. "Shape"
145
- means the component reads applicable radius, border-width, shadow, hover, or
146
- clip/edge material tokens; an aesthetic may intentionally affect only the
147
- materials that component draws.
96
+ This table is the authoritative axis map for demonstrated components. "Shape" means the component reads applicable radius, border-width, shadow, hover, or clip/edge material tokens; an aesthetic may intentionally affect only the materials that component draws.
148
97
 
149
- Presentation is two independent axes, so they get a column each. A `Yes` means
150
- the class changes what the component computes, which
151
- `tests/browser/axes.spec.ts` asserts against `registry.json` in both
152
- directions: an axis marked `Yes` must move, and an axis marked `No` must not.
98
+ Presentation is two independent axes, so they get a column each. A `Yes` means the class changes what the component computes, which `tests/browser/axes.spec.ts` asserts against `registry.json` in both directions: an axis marked `Yes` must move, and an axis marked `No` must not.
153
99
 
154
100
  | Components | Intent | Fill | Edge | Aesthetic material |
155
101
  | --------------------------------------------------------- | ------ | ---- | ---- | ------------------ |
@@ -168,24 +114,15 @@ directions: an axis marked `Yes` must move, and an axis marked `No` must not.
168
114
  | `.tooltip` | Yes | Yes | Yes | Shape and overlay |
169
115
  | `.table-wrap`, `.quote-inline`, layout and text utilities | No | No | No | No |
170
116
 
171
- `.checkbox` and `.radio` are the only components that read one axis and not
172
- the other. Their line is the only thing marking an unchecked box, so it is
173
- drawn whatever the edge class says, from a container or from the element
174
- itself. `.edgeless` on either is unsupported rather than merely discouraged.
117
+ `.checkbox` and `.radio` are the only components that read one axis and not the other. Their line is the only thing marking an unchecked box, so it is drawn whatever the edge class says, from a container or from the element itself. `.edgeless` on either is unsupported rather than merely discouraged.
175
118
 
176
- Every other text control floors a _cascaded_ `.edgeless` and honours its own:
177
- a `.edgeless` toolbar will not erase the line of a field nobody classed, while
178
- `.ipt.edgeless` is a consumer describing what they want and gets it.
119
+ Every other text control floors a _cascaded_ `.edgeless` and honours its own: a `.edgeless` toolbar will not erase the line of a field nobody classed, while `.ipt.edgeless` is a consumer describing what they want and gets it.
179
120
 
180
- Intent aliases such as `.danger` and `.error` occupy the same intent axis as
181
- `.destructive`; they do not add component behavior. State and modifier
182
- classes such as `.interactive`, `.loading`, `.invalid`, `.compact`, and
183
- `.vertical` sit above this map and are documented with their component.
121
+ Intent aliases such as `.danger` and `.error` occupy the same intent axis as `.destructive`; they do not add component behavior. State and modifier classes such as `.interactive`, `.hoverable`, `.pressable`, `.loading`, `.invalid`, `.compact`, and `.vertical` sit above this map and are documented with their component.
184
122
 
185
123
  ## Elevation
186
124
 
187
- Depth is a modifier, not an axis. Nothing is raised until an
188
- [aesthetic](./aesthetics.md) draws depth or one of these classes asks for it.
125
+ Depth is a modifier, not an axis. Nothing is raised until an [aesthetic](./aesthetics.md) draws depth or one of these classes asks for it.
189
126
 
190
127
  | Class | Alias | Depth |
191
128
  | ----------------- | ----------- | ------------------------------------------------------------------------ |
@@ -193,17 +130,9 @@ Depth is a modifier, not an axis. Nothing is raised until an
193
130
  | `.elevation-sm` | `.raised` | One unit of the depth in scope. Cards, tiles, popovers that sit close. |
194
131
  | `.elevation-md` | `.floating` | Twice it, for menus and popovers. |
195
132
 
196
- Both names in a row are equivalent, interchangeable classes — `.elevation-sm`
197
- and `.raised` are aliases, not a canonical form and a deprecated one, the way
198
- `.destructive` and `.danger` are on the intent axis. The `none`/`sm`/`md`
199
- naming matches the raw `--elevation-*` tokens in
200
- [Theming](./theming.md#foundation-tokens) for the same weight of depth, even
201
- though the two are read from different places.
133
+ Both names in a row are equivalent, interchangeable classes — `.elevation-sm` and `.raised` are aliases, not a canonical form and a deprecated one, the way `.destructive` and `.danger` are on the intent axis. The `none`/`sm`/`md` naming matches the raw `--elevation-*` tokens in [Theming](./theming.md#foundation-tokens) for the same weight of depth, even though the two are read from different places.
202
134
 
203
- Each is one unitless multiplier over whatever shadow geometry is in scope, so
204
- the same class reads as a soft blur on a plain page and as a hard offset slab
205
- under `.neobrutalism` — the aesthetic decides what depth looks like, the
206
- class decides how much of it this element takes.
135
+ Each is one unitless multiplier over whatever shadow geometry is in scope, so the same class reads as a soft blur on a plain page and as a hard offset slab under `.neobrutalism` — the aesthetic decides what depth looks like, the class decides how much of it this element takes.
207
136
 
208
137
  ```html
209
138
  <article class="card elevation-sm">Lifted</article>
@@ -211,8 +140,4 @@ class decides how much of it this element takes.
211
140
  <article class="card elevation-none">Flat, whatever the page or container says</article>
212
141
  ```
213
142
 
214
- The multiplier is a plain number, so it inherits: a container lifts or
215
- flattens a whole region and any element inside it still opts out on itself.
216
- Spread is deliberately left out of the multiplication, because an aesthetic
217
- that draws its edge as an inset ring spends spread on it and scaling that
218
- would erase the edge.
143
+ The multiplier is a plain number, so it inherits: a container lifts or flattens a whole region and any element inside it still opts out on itself. Spread is deliberately left out of the multiplication, because an aesthetic that draws its edge as an inset ring spends spread on it and scaling that would erase the edge.
@@ -1,32 +1,25 @@
1
1
  ---
2
2
  title: Content and layout
3
3
  description: Layout helpers, content chips and tables, surfaces, and typography utilities.
4
+ order: 9
4
5
  ---
5
6
 
6
7
  # Content and layout
7
8
 
8
9
  ## Layout
9
10
 
10
- Layout helpers use the shared `--layout-gap` token. `.tight` sets it to
11
- `0.5rem` and `.loose` sets it to `1.5rem` within a view, stack, cluster, or
12
- auto-grid.
11
+ Layout helpers use the shared `--layout-gap` token. `.tight` sets it to `0.5rem` and `.loose` sets it to `1.5rem` within a view, stack, cluster, or auto-grid.
13
12
 
14
- - `.view` is a flex container; `.vertical` and `.horizontal` set its
15
- direction, and horizontal views wrap with centered cross-axis alignment.
13
+ - `.view` is a flex container; `.vertical` and `.horizontal` set its direction, and horizontal views wrap with centered cross-axis alignment.
16
14
  - `.stack` is a vertical flex stack.
17
- - `.cluster` is a wrapping horizontal flex row; `.between` adds
18
- `space-between` alignment.
15
+ - `.cluster` is a wrapping horizontal flex row; `.between` adds `space-between` alignment.
19
16
  - `.auto-grid` is a responsive auto-fit grid using `--layout-grid-min`.
20
- - `.tight` and `.loose` set the shared gap to `0.5rem` or `1.5rem` on views,
21
- stacks, clusters, and auto-grids.
17
+ - `.tight` and `.loose` set the shared gap to `0.5rem` or `1.5rem` on views, stacks, clusters, and auto-grids.
22
18
  - `.section` adds responsive block padding and an inline gutter.
23
- - `.section-content` centers content at `--container-max`; `.narrow` and
24
- `.wide` select the corresponding container tokens.
25
- - `.divider` is horizontal; `.vertical` makes it self-stretch vertically. It
26
- takes intent, but presentation classes do not affect it.
19
+ - `.section-content` centers content at `--container-max`; `.narrow` and `.wide` select the corresponding container tokens.
20
+ - `.divider` is horizontal; `.vertical` makes it self-stretch vertically. It takes intent, but presentation classes do not affect it.
27
21
 
28
- The removed `--layout-stack-gap` and `--layout-cluster-gap` tokens have no
29
- compatibility aliases.
22
+ The removed `--layout-stack-gap` and `--layout-cluster-gap` tokens have no compatibility aliases.
30
23
 
31
24
  ## Content
32
25
 
@@ -44,8 +37,7 @@ compatibility aliases.
44
37
 
45
38
  ### Table rules
46
39
 
47
- A table draws three kinds of line, and `.ruled` and `.ruleless` move all of
48
- them together:
40
+ A table draws three kinds of line, and `.ruled` and `.ruleless` move all of them together:
49
41
 
50
42
  | Class | Head and foot boundaries | Rules between body rows |
51
43
  | ----------- | ------------------------ | ----------------------- |
@@ -54,36 +46,32 @@ them together:
54
46
  | `.ruled` | Yes | Yes |
55
47
 
56
48
  ```html
57
- <table class="data-table">Head and foot boundaries only</table>
58
- <table class="data-table ruled">Every row separated</table>
59
- <table class="data-table ruleless">No lines inside the table at all</table>
49
+ <table class="data-table">
50
+ Head and foot boundaries only
51
+ </table>
52
+ <table class="data-table ruled">
53
+ Every row separated
54
+ </table>
55
+ <table class="data-table ruleless">
56
+ No lines inside the table at all
57
+ </table>
60
58
  ```
61
59
 
62
- The boundaries under a head and above a foot separate the parts of a table
63
- from each other, so they are drawn by default where the row rules are not.
64
- Rules between body rows used to arrive on their own, because the
65
- component's published edge default is `edged` and the edge axis wrote the
66
- rules along with the boundary — so whether you got them depended on a
67
- registry default rather than on anything in your markup.
60
+ The boundaries under a head and above a foot separate the parts of a table from each other, so they are drawn by default where the row rules are not. Rules between body rows used to arrive on their own, because the component's published edge default is `edged` and the edge axis wrote the rules along with the boundary — so whether you got them depended on a registry default rather than on anything in your markup.
68
61
 
69
- `--ui-rule` is the token behind both classes, so a container can set the
70
- answer for a whole region without classing each table:
62
+ `--ui-rule` is the token behind both classes, so a container can set the answer for a whole region without classing each table:
71
63
 
72
64
  ```html
73
65
  <section style="--ui-rule: 100%">
74
- <table class="data-table">Ruled by the region</table>
66
+ <table class="data-table">
67
+ Ruled by the region
68
+ </table>
75
69
  </section>
76
70
  ```
77
71
 
78
- The frame around the table is the edge axis and is asked for the same way:
79
- `.data-table` publishes `edgeless`, so `.edged` draws one. None of the
80
- three switches reaches the others — `.data-table.ruleless.edged` is a
81
- framed table with no lines inside it, and `.data-table.ruled` is a
82
- frameless one with every row separated.
72
+ The frame around the table is the edge axis and is asked for the same way: `.data-table` publishes `edgeless`, so `.edged` draws one. None of the three switches reaches the others — `.data-table.ruleless.edged` is a framed table with no lines inside it, and `.data-table.ruled` is a frameless one with every row separated.
83
73
 
84
- A table's rows deliberately inherit its intent instead of resetting it, so
85
- `.data-table.success` tints throughout. A row carrying its own intent still
86
- wins:
74
+ A table's rows deliberately inherit its intent instead of resetting it, so `.data-table.success` tints throughout. A row carrying its own intent still wins:
87
75
 
88
76
  ```html
89
77
  <table class="data-table success">
@@ -98,37 +86,28 @@ wins:
98
86
  </table>
99
87
  ```
100
88
 
101
- This is the one place intent cascades, because a table's rows are parts of
102
- the table rather than independent components.
89
+ This is the one place intent cascades, because a table's rows are parts of the table rather than independent components.
103
90
 
104
- `.data-table`, `.kbd`, `.code`, and `.pre` also read
105
- [presentation](./composing.md#presentation). A table applies it to its
106
- header, its rules and its border; a chip to its whole plate:
91
+ `.data-table`, `.kbd`, `.code`, and `.pre` also read [presentation](./composing.md#presentation). A table applies it to its header, its rules and its border; a chip to its whole plate:
107
92
 
108
93
  ```html
109
- <table class="data-table success soft edged">...</table>
110
- <table class="data-table">A ghost table: rules and type, no header plate</table>
94
+ <table class="data-table success soft edged">
95
+ ...
96
+ </table>
97
+ <table class="data-table">
98
+ A ghost table: rules and type, no header plate
99
+ </table>
111
100
  <kbd class="kbd primary solid">Ctrl</kbd>
112
101
  <kbd class="kbd primary soft edged">Shift</kbd>
113
102
  ```
114
103
 
115
- `.ghost` means two different things on these components, and both are worth
116
- knowing before you reach for it.
104
+ `.ghost` means two different things on these components, and both are worth knowing before you reach for it.
117
105
 
118
- On `.data-table` it removes the header plate along with the body tint, so
119
- `.data-table.ghost` is boundaries and type alone. The component rests at
120
- `soft`, so that is something to ask for rather than the default.
106
+ On `.data-table` it removes the header plate along with the body tint, so `.data-table.ghost` is boundaries and type alone. The component rests at `soft`, so that is something to ask for rather than the default.
121
107
 
122
- On `.kbd`, `.code`, and `.pre` it is **not supported**. All three rest on
123
- `--intent-subtle`, and that ground draws the plate whatever the fill says —
124
- so `.ghost` took the fill away and changed nothing visible. Worse, the
125
- ground alone is a near-page tint: a ghost chip measured the same `#e5e5e5`
126
- for neutral and primary on the light page, and `#f5f5f5` at 1.04:1 against
127
- it for secondary. All three rest at `.soft` instead, which puts a real `12%`
128
- of the intent over the ground and separates them.
108
+ On `.kbd`, `.code`, and `.pre` it is **not supported**. All three rest on `--intent-subtle`, and that ground draws the plate whatever the fill says — so `.ghost` took the fill away and changed nothing visible. Worse, the ground alone is a near-page tint: a ghost chip measured the same `#e5e5e5` for neutral and primary on the light page, and `#f5f5f5` at 1.04:1 against it for secondary. All three rest at `.soft` instead, which puts a real `12%` of the intent over the ground and separates them.
129
109
 
130
- Use `.table-wrap` around `.data-table` when table width may exceed its
131
- container:
110
+ Use `.table-wrap` around `.data-table` when table width may exceed its container:
132
111
 
133
112
  ```html
134
113
  <div class="table-wrap">
@@ -151,38 +130,34 @@ container:
151
130
 
152
131
  ## Surfaces
153
132
 
154
- | Class | Purpose |
155
- | -------------------- | ---------------------------------------------------------------------------- |
156
- | `.card` | Bordered container, surface radius, padded. Rests at elevation `1`. |
157
- | `.panel` | Flush container for sidebars, toolbars, and wells. No elevation. |
158
- | `.interactive` | On `.card`. Adds pointer cursor, hover and press response, and a focus ring. |
159
- | `.p-sm`, `.compact` | On `.card` or `.panel`. Reduces padding. |
160
- | `.p-lg`, `.spacious` | On `.card` or `.panel`. Increases padding. |
161
- | `.flush` | On `.card` or `.panel`. Removes padding, for edge-to-edge content. |
162
-
163
- Both read intent, [presentation](./composing.md#presentation), and
164
- [material tokens](./customizing.md#material-tokens). A plain `.card` is a
165
- neutral bordered container; only an explicit presentation tints it. Resting
166
- at elevation `1` is not a visible shadow by itself — nothing draws depth
167
- until an [aesthetic](./aesthetics.md) supplies shadow geometry or
168
- `.elevation-sm`/`.elevation-md` asks for it; see
169
- [Composing → Elevation](./composing.md#elevation).
170
-
171
- On the base look, `.card.interactive` scales down slightly on press
172
- (`--ui-active-transform`, `scale(0.97)`); an [aesthetic](./aesthetics.md)
173
- substitutes its own press gesture, and `prefers-reduced-motion` turns it off.
133
+ | Class | Purpose |
134
+ | -------------------- | ------------------------------------------------------------------------------------- |
135
+ | `.card` | Bordered container, surface radius, padded. Rests at elevation `1`. |
136
+ | `.panel` | Flush container for sidebars, toolbars, and wells. No elevation. |
137
+ | `.interactive` | On `.card`. Adds pointer cursor, hover and press response, and a focus ring. |
138
+ | `.hoverable` | On `.card`. The hover half of `.interactive`: hover response only, no pointer cursor. |
139
+ | `.pressable` | On `.card`. The press half of `.interactive`: press response and pointer cursor. |
140
+ | `.p-xs`, `.dense` | On `.card` or `.panel`. Reduces padding further than `.compact`. |
141
+ | `.p-sm`, `.compact` | On `.card` or `.panel`. Reduces padding. |
142
+ | `.p-lg`, `.spacious` | On `.card` or `.panel`. Increases padding. |
143
+ | `.flush` | On `.card` or `.panel`. Removes padding, for edge-to-edge content. |
144
+
145
+ Both read intent, [presentation](./composing.md#presentation), and [material tokens](./customizing.md#material-tokens). A plain `.card` is a neutral bordered container; only an explicit presentation tints it. Resting at elevation `1` is not a visible shadow by itself — nothing draws depth until an [aesthetic](./aesthetics.md) supplies shadow geometry or `.elevation-sm`/`.elevation-md` asks for it; see [Composing → Elevation](./composing.md#elevation).
146
+
147
+ On the base look, `.card.interactive` scales down slightly on press (`--ui-active-transform`, `scale(0.97)`); an [aesthetic](./aesthetics.md) substitutes its own press gesture, and `prefers-reduced-motion` turns it off.
148
+
149
+ `.interactive` is the pair `.hoverable` (hover response only, no pointer cursor) and `.pressable` (press response and pointer cursor) applied together. Take one half for a card that answers a single gesture: a card that warms on hover but holds its own action in a nested button takes `.hoverable`, so pressing that button does not dip the whole card.
174
150
 
175
151
  ```html
176
152
  <article class="card">Neutral card</article>
177
153
  <article class="card success soft">Tinted success card</article>
178
154
  <article class="card primary ghost edged">Intent border, no fill</article>
179
155
  <a class="card interactive" href="/package">Responds to hover and press</a>
156
+ <article class="card hoverable">Warms on hover; the action is a nested button</article>
180
157
  <aside class="panel">Flush panel</aside>
181
158
  ```
182
159
 
183
- `.interactive` is styling only. Use a real interactive element and give it
184
- an accessible name; a `<div class="card interactive">` is not focusable or
185
- operable by keyboard.
160
+ `.interactive` and `.pressable` are styling only. Use a real interactive element and give it an accessible name; a `<div class="card interactive">` is not focusable or operable by keyboard.
186
161
 
187
162
  ## Typography utilities
188
163
 
@@ -1,20 +1,16 @@
1
1
  ---
2
2
  title: Customizing
3
3
  description: Presentation and material token reference, and aesthetic knobs.
4
+ order: 3
4
5
  ---
5
6
 
6
7
  # Customizing
7
8
 
8
- Presentation tokens decide how much of an intent shows. Material tokens
9
- decide what a component is made of. Aesthetic tokens are the small set of
10
- named knobs a shipped aesthetic exposes to scale its own look.
9
+ Presentation tokens decide how much of an intent shows. Material tokens decide what a component is made of. Aesthetic tokens are the small set of named knobs a shipped aesthetic exposes to scale its own look.
11
10
 
12
11
  ## Presentation tokens
13
12
 
14
- Presentation tokens describe _how much_ of an intent a component shows,
15
- never _which_ intent it shows. They are unitless numbers and percentages, so
16
- they carry no color and inherit safely: a container sets them once and every
17
- component below resolves them against its own intent.
13
+ Presentation tokens describe _how much_ of an intent a component shows, never _which_ intent it shows. They are unitless numbers and percentages, so they carry no color and inherit safely: a container sets them once and every component below resolves them against its own intent.
18
14
 
19
15
  | Token | Purpose |
20
16
  | ----------------- | -------------------------------------------------------------------------- |
@@ -22,45 +18,25 @@ component below resolves them against its own intent.
22
18
  | `--ui-fg-on-fill` | Percentage blended from the intent readable tone toward its contrast tone. |
23
19
  | `--ui-border` | Percentage of the intent color mixed into the border color. |
24
20
 
25
- A component resolves them with `color-mix` from its published default. Hover
26
- is derived by adding `--hover-step` to the resting fill and using
27
- `--intent-hover`; there are no per-presentation hover tokens.
21
+ A component resolves them with `color-mix` from its published default. Hover is derived by adding `--hover-step` to the resting fill and using `--intent-hover`; there are no per-presentation hover tokens.
28
22
 
29
- No fill class writes `--ui-border` and no edge class writes `--ui-fill`. A
30
- filled box with no line is `.solid.edgeless`, which is worth reaching for on
31
- a neutral component: neutral caps its fill, so the box stays translucent and
32
- a border over it paints a second coat of the same tint instead of blending
33
- into it.
23
+ No fill class writes `--ui-border` and no edge class writes `--ui-fill`. A filled box with no line is `.solid.edgeless`, which is worth reaching for on a neutral component: neutral caps its fill, so the box stays translucent and a border over it paints a second coat of the same tint instead of blending into it.
34
24
 
35
25
  ```css
36
26
  background: color-mix(in oklab, var(--color-primary) var(--ui-fill, 100%), transparent);
37
27
  ```
38
28
 
39
- Two choices there are deliberate. Mixing toward `transparent` rather than a
40
- background token lets a tinted surface adapt to whatever it is placed on.
41
- Mixing in `oklab` keeps the wide-gamut token palette intact and blends
42
- perceptually, where `srgb` would clip it.
29
+ Two choices there are deliberate. Mixing toward `transparent` rather than a background token lets a tinted surface adapt to whatever it is placed on. Mixing in `oklab` keeps the wide-gamut token palette intact and blends perceptually, where `srgb` would clip it.
43
30
 
44
- A computed color therefore reaches the page as a resolved `color-mix` result
45
- rather than the token's own `oklch` syntax. It is the same color; code that
46
- compares computed color strings should compare colors instead.
31
+ A computed color therefore reaches the page as a resolved `color-mix` result rather than the token's own `oklch` syntax. It is the same color; code that compares computed color strings should compare colors instead.
47
32
 
48
- > **Presentation token contract**: only presentation classes and consumer
49
- > overrides set these tokens; components only read them. Setting a value
50
- > that no presentation class produces is supported but unvalidated. See
51
- > [Composing](./composing.md) for the classes that ship these values.
33
+ > **Presentation token contract**: only presentation classes and consumer overrides set these tokens; components only read them. Setting a value that no presentation class produces is supported but unvalidated. See [Composing](./composing.md) for the classes that ship these values.
52
34
 
53
35
  ## Material tokens
54
36
 
55
- Material tokens describe what a component is _made of_ rather than which
56
- intent it shows or how strongly. They control shape, borders, shadows,
57
- translucency, filters, and transforms.
37
+ Material tokens describe what a component is _made of_ rather than which intent it shows or how strongly. They control shape, borders, shadows, translucency, filters, and transforms.
58
38
 
59
- Components read each with a fallback, so leaving them unset produces the
60
- default look. Setting them on a container restyles the whole subtree. Only
61
- shadow geometry is split into colorless parts that inherit safely;
62
- color-capable inputs such as `--ui-ink` and `--ui-surface-shadow` may
63
- include their own colors.
39
+ Components read each with a fallback, so leaving them unset produces the default look. Setting them on a container restyles the whole subtree. Only shadow geometry is split into colorless parts that inherit safely; color-capable inputs such as `--ui-ink` and `--ui-surface-shadow` may include their own colors.
64
40
 
65
41
  | Token | Purpose | Fallback |
66
42
  | ----------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------- |
@@ -99,29 +75,15 @@ include their own colors.
99
75
  </section>
100
76
  ```
101
77
 
102
- > **Material token contract**: components read these; aesthetic classes and
103
- > consumer overrides set them.
78
+ > **Material token contract**: components read these; aesthetic classes and consumer overrides set them.
104
79
 
105
80
  ### Shape and ring composition
106
81
 
107
- Clipping removes borders, outlines, and outer shadows. An aesthetic that uses
108
- a clip can replace the border with an inset shadow by setting
109
- `--ui-shadow-inset` and the four shadow geometry parts. Set
110
- `--ui-border-max: 0px` when that ring replaces the component border.
111
- Focusable components restore the clipped focus outline through
112
- `--ui-focus-inset`.
113
-
114
- Declare `--ui-shadow-edge` when that ring _is_ the border. The ring then
115
- takes the element's edge color, which carries the edge axis as its alpha, so
116
- `.edged` draws it and `.edgeless` does not — the same answer a real border
117
- gives. Without it the ring paints on every component the aesthetic reaches
118
- and the edge classes have no effect. Use `--ui-shadow-ink` instead when the
119
- shadow is depth cast in the intent's own ink, such as a hard offset slab,
120
- which an `.edgeless` element still gets.
121
-
122
- The token is read for its presence, not its value: declare it empty to
123
- switch the ring on, and `initial` to switch it back off in an aesthetic
124
- nested inside one that declares it.
82
+ Clipping removes borders, outlines, and outer shadows. An aesthetic that uses a clip can replace the border with an inset shadow by setting `--ui-shadow-inset` and the four shadow geometry parts. Set `--ui-border-max: 0px` when that ring replaces the component border. Focusable components restore the clipped focus outline through `--ui-focus-inset`.
83
+
84
+ Declare `--ui-shadow-edge` when that ring _is_ the border. The ring then takes the element's edge color, which carries the edge axis as its alpha, so `.edged` draws it and `.edgeless` does not — the same answer a real border gives. Without it the ring paints on every component the aesthetic reaches and the edge classes have no effect. Use `--ui-shadow-ink` instead when the shadow is depth cast in the intent's own ink, such as a hard offset slab, which an `.edgeless` element still gets.
85
+
86
+ The token is read for its presence, not its value: declare it empty to switch the ring on, and `initial` to switch it back off in an aesthetic nested inside one that declares it.
125
87
 
126
88
  ```css
127
89
  .stepped {
@@ -138,16 +100,11 @@ nested inside one that declares it.
138
100
  }
139
101
  ```
140
102
 
141
- Variables named `--shape-*` are internal composition outputs. Do not set or
142
- read them; only the `--ui-*` inputs above are public.
103
+ Variables prefixed `--_` are internal composition outputs — `--_bg`, `--_fg`, `--_edge`, `--_fill`, `--_shadow`, and the `--_d-*` resting slots a component states for `box` to read. Do not set or read them; only the `--ui-*` inputs above are public.
143
104
 
144
105
  ## Aesthetic tokens
145
106
 
146
- The shipped [aesthetic classes](./aesthetics.md) set material tokens for you.
147
- Only aesthetics with a token listed below expose an aesthetic-specific
148
- token. Tune all other behavior through the shared material tokens above.
149
- Listed tokens are available only where that aesthetic's stylesheet is
150
- imported.
107
+ The shipped [aesthetic classes](./aesthetics.md) set material tokens for you. Only aesthetics with a token listed below expose an aesthetic-specific token. Tune all other behavior through the shared material tokens above. Listed tokens are available only where that aesthetic's stylesheet is imported.
151
108
 
152
109
  | Token | Aesthetic | Purpose | Default |
153
110
  | ------------------------ | --------------- | ----------------------------------------------------------- | --------------------------------- |
@@ -160,11 +117,7 @@ imported.
160
117
  | `--tile-lift` | `.chunky-tile` | Depth of the seated bar, and how far a press travels. | `4px` |
161
118
  | `--font-rounded` | `.chunky-tile` | Consumer-supplied rounded font stack. | Falls back to the page stack |
162
119
 
163
- All four aesthetics reach the same way: each knob is _read_ with its default
164
- as a `var()` fallback rather than declared, so it resolves once into a
165
- private on the aesthetic's own class (`--_pixel-unit`, `--_neo-offset`,
166
- `--_tile-radius`, `--_tile-lift`, and so on). Set a knob on the element
167
- carrying the aesthetic class, or on any ancestor including `:root`:
120
+ All four aesthetics reach the same way: each knob is _read_ with its default as a `var()` fallback rather than declared, so it resolves once into a private on the aesthetic's own class (`--_pixel-unit`, `--_neo-offset`, `--_tile-radius`, `--_tile-lift`, and so on). Set a knob on the element carrying the aesthetic class, or on any ancestor including `:root`:
168
121
 
169
122
  ```html
170
123
  <section class="pixel" style="--pixel-unit: 6px">
@@ -180,34 +133,16 @@ carrying the aesthetic class, or on any ancestor including `:root`:
180
133
  </html>
181
134
  ```
182
135
 
183
- Knobs and material tokens reach in opposite directions, and telling them
184
- apart matters. A knob resolves once at the aesthetic's own class and
185
- inherits down already-resolved, so it reaches the aesthetic **from above**:
186
- setting it on the element or any ancestor works, but setting it on a
187
- _descendant_ of the aesthetic class changes nothing — the value has already
188
- been read. `--ui-radius` and the other material tokens above are read fresh
189
- by each component as it draws, so they reach **at or below** the element
190
- carrying them, which is how you round one card differently from its
191
- neighbours without touching the knob at all.
136
+ Knobs and material tokens reach in opposite directions, and telling them apart matters. A knob resolves once at the aesthetic's own class and inherits down already-resolved, so it reaches the aesthetic **from above**: setting it on the element or any ancestor works, but setting it on a _descendant_ of the aesthetic class changes nothing — the value has already been read. `--ui-radius` and the other material tokens above are read fresh by each component as it draws, so they reach **at or below** the element carrying them, which is how you round one card differently from its neighbours without touching the knob at all.
192
137
 
193
- Shipped aesthetics set the shared material tokens above. `.neobrutalism` and
194
- `.pixel` set `--ui-ink` for their neutral outline; intent classes still
195
- override the intent slots on each component.
138
+ Shipped aesthetics set the shared material tokens above. `.neobrutalism` and `.pixel` set `--ui-ink` for their neutral outline; intent classes still override the intent slots on each component.
196
139
 
197
140
  ## Component internals
198
141
 
199
- Component classes may define scoped implementation variables such as
200
- `--button-*`, `--surface-*`, `--control-*`, `--feedback-*`, and `--tooltip-*`.
201
- These variables are internal wiring for class composition and are not the
202
- public token contract.
142
+ Component classes may define scoped implementation variables such as `--surface-padding`, `--field-gap`, `--input-group-pad`, `--switch-*`, `--table-*`, `--quote-*`, and `--tooltip-*`. These variables are internal wiring for class composition and are not the public token contract.
203
143
 
204
- Consumers should customize broad behavior through color, foundation, motion,
205
- elevation, radius, layout, and focus tokens first. The only supported
206
- component-scoped input is `--progress-value` on the `.progress` element,
207
- because consumers must provide a value such as `64%`.
144
+ Consumers should customize broad behavior through color, foundation, motion, elevation, radius, layout, and focus tokens first. The only supported component-scoped input is `--progress-value` on the `.progress` element, because consumers must provide a value such as `64%`.
208
145
 
209
- `--layout-gap` replaces the removed `--layout-stack-gap` and
210
- `--layout-cluster-gap` tokens. No compatibility aliases are provided.
146
+ `--layout-gap` replaces the removed `--layout-stack-gap` and `--layout-cluster-gap` tokens. No compatibility aliases are provided.
211
147
 
212
- Next: [Aesthetics](./aesthetics.md) covers each shipped aesthetic's complete
213
- look and its documented exceptions.
148
+ Next: [Aesthetics](./aesthetics.md) covers each shipped aesthetic's complete look and its documented exceptions.