actual-css 0.2.0 → 0.3.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 (214) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/README.md +24 -9
  3. package/dist/actual-themes.min.css +1 -0
  4. package/dist/actual.css +1532 -1114
  5. package/dist/actual.js +1 -3
  6. package/dist/actual.min.css +1 -1
  7. package/dist/optional.css +1048 -0
  8. package/dist/optional.min.css +1 -0
  9. package/docs/design-notes/browser-support.md +94 -14
  10. package/docs/design-notes/cascade-layer.md +7 -6
  11. package/docs/design-notes/enhancement-contract.md +11 -14
  12. package/docs/design-notes/forced-colors.md +105 -0
  13. package/docs/design-notes/naming.md +2 -1
  14. package/docs/design-notes/platform-alignment.md +492 -0
  15. package/docs/design-notes/references.md +8 -0
  16. package/docs/design-notes/widget-primitives.md +37 -1
  17. package/docs/navigation.json +135 -0
  18. package/docs/pages/components/accordion.md +80 -0
  19. package/docs/pages/components/alert.md +203 -0
  20. package/docs/pages/components/aura.md +35 -0
  21. package/docs/pages/components/avatar.md +95 -0
  22. package/docs/pages/components/badge.md +102 -0
  23. package/docs/pages/components/breadcrumb.md +19 -0
  24. package/docs/pages/components/button.md +210 -0
  25. package/docs/pages/components/card.md +195 -0
  26. package/docs/pages/components/chat.md +50 -0
  27. package/docs/pages/components/dialog.md +367 -0
  28. package/docs/pages/components/drawer.md +113 -0
  29. package/docs/pages/components/fab.md +118 -0
  30. package/docs/pages/components/key.md +33 -0
  31. package/docs/pages/components/meter.md +23 -0
  32. package/docs/pages/components/navbar.md +92 -0
  33. package/docs/pages/components/pagination.md +55 -0
  34. package/docs/pages/components/progress.md +29 -0
  35. package/docs/pages/components/skeleton.md +38 -0
  36. package/docs/pages/components/spinner.md +93 -0
  37. package/docs/pages/components/table.md +102 -0
  38. package/docs/pages/enhancements/flyout.md +391 -0
  39. package/docs/pages/enhancements/overview.md +36 -0
  40. package/docs/pages/enhancements/scrollspy.md +71 -0
  41. package/docs/pages/enhancements/status-bar.md +72 -0
  42. package/docs/pages/enhancements/tabs.md +80 -0
  43. package/docs/pages/enhancements/tooltip.md +130 -0
  44. package/docs/pages/examples/overview.md +43 -0
  45. package/docs/pages/forms/choice-cards.md +102 -0
  46. package/docs/pages/forms/controls.md +32 -0
  47. package/docs/pages/forms/detached-actions.md +59 -0
  48. package/docs/pages/forms/floating-field.md +88 -0
  49. package/docs/pages/forms/form-actions.md +56 -0
  50. package/docs/pages/forms/input-policy.md +91 -0
  51. package/docs/pages/forms/joined-controls.md +37 -0
  52. package/docs/pages/forms/labels.md +42 -0
  53. package/docs/pages/forms/otp.md +50 -0
  54. package/docs/pages/forms/overview.md +188 -0
  55. package/docs/pages/forms/password.md +40 -0
  56. package/docs/pages/forms/range.md +17 -0
  57. package/docs/pages/forms/states-and-sizes.md +321 -0
  58. package/docs/pages/forms/sticky-actions.md +187 -0
  59. package/docs/pages/forms/switch.md +31 -0
  60. package/docs/pages/forms/validation.md +241 -0
  61. package/docs/{mental-model.md → pages/foundations/philosophy.md} +33 -18
  62. package/docs/pages/foundations/theming.md +99 -0
  63. package/docs/pages/foundations/tokens.md +421 -0
  64. package/docs/{typography.md → pages/foundations/typography.md} +27 -9
  65. package/docs/pages/guides/bootstrap.md +438 -0
  66. package/docs/pages/guides/introduction.md +157 -0
  67. package/docs/pages/guides/optional-components.md +33 -0
  68. package/docs/pages/guides/progressive-enhancement.md +686 -0
  69. package/docs/pages/guides/tailwind.md +455 -0
  70. package/docs/pages/layout/app-shell.md +25 -0
  71. package/docs/pages/layout/center.md +29 -0
  72. package/docs/pages/layout/cluster.md +59 -0
  73. package/docs/pages/layout/frame.md +30 -0
  74. package/docs/pages/layout/grid.md +142 -0
  75. package/docs/pages/layout/list.md +41 -0
  76. package/docs/pages/layout/media.md +28 -0
  77. package/docs/pages/layout/overview.md +37 -0
  78. package/docs/pages/layout/scroll-snap.md +54 -0
  79. package/docs/pages/layout/sidebar-layout.md +27 -0
  80. package/docs/pages/layout/stack.md +55 -0
  81. package/docs/pages/layout/switcher.md +36 -0
  82. package/docs/pages/layout/topbar.md +23 -0
  83. package/docs/pages/patterns/actions.md +52 -0
  84. package/docs/pages/patterns/code-block.md +36 -0
  85. package/docs/pages/patterns/exclusive-accordion.md +16 -0
  86. package/docs/pages/patterns/hierarchical-nav.md +26 -0
  87. package/docs/pages/patterns/icon-input.md +25 -0
  88. package/docs/pages/patterns/intent-nesting.md +3 -0
  89. package/docs/pages/patterns/navigation-list.md +235 -0
  90. package/docs/pages/patterns/overview.md +58 -0
  91. package/docs/pages/patterns/structured-lists.md +47 -0
  92. package/docs/pages/utilities/accessibility.md +34 -0
  93. package/docs/pages/utilities/flex.md +105 -0
  94. package/docs/pages/utilities/links.md +18 -0
  95. package/docs/pages/utilities/list.md +32 -0
  96. package/docs/pages/utilities/overflow.md +43 -0
  97. package/docs/pages/utilities/overview.md +18 -0
  98. package/docs/pages/utilities/shape.md +25 -0
  99. package/docs/pages/utilities/sizing-wrapping.md +115 -0
  100. package/docs/pages/utilities/spacing.md +79 -0
  101. package/docs/pages/utilities/text.md +43 -0
  102. package/llms.txt +4 -4
  103. package/package.json +21 -12
  104. package/src/css/actual.css +16 -2
  105. package/src/css/base.css +3 -5
  106. package/src/css/components/accordion.css +18 -30
  107. package/src/css/components/actions.css +4 -1
  108. package/src/css/components/alert.css +139 -102
  109. package/src/css/components/avatar.css +16 -10
  110. package/src/css/components/badge.css +69 -42
  111. package/src/css/components/breadcrumb.css +7 -15
  112. package/src/css/components/busy.css +6 -0
  113. package/src/css/components/button.css +84 -34
  114. package/src/css/components/card.css +26 -38
  115. package/src/css/components/drawer.css +30 -13
  116. package/src/css/components/flyout.css +39 -109
  117. package/src/css/components/index.css +1 -0
  118. package/src/css/components/join.css +14 -2
  119. package/src/css/components/key.css +2 -0
  120. package/src/css/components/menu.css +125 -0
  121. package/src/css/components/meter.css +0 -23
  122. package/src/css/components/modal.css +162 -7
  123. package/src/css/components/navbar.css +30 -23
  124. package/src/css/components/overline.css +8 -9
  125. package/src/css/components/pagination.css +1 -1
  126. package/src/css/components/progress.css +8 -26
  127. package/src/css/components/skeleton.css +7 -0
  128. package/src/css/components/spinner.css +6 -7
  129. package/src/css/components/status-bar.css +15 -24
  130. package/src/css/components/surface.css +2 -8
  131. package/src/css/components/tab.css +19 -48
  132. package/src/css/components/table.css +7 -5
  133. package/src/css/components/tooltip.css +14 -7
  134. package/src/css/focus.css +14 -38
  135. package/src/css/forms/choice-card.css +13 -14
  136. package/src/css/forms/choice.css +21 -27
  137. package/src/css/forms/control.css +18 -17
  138. package/src/css/forms/custom-select.css +9 -11
  139. package/src/css/forms/form-actions.css +14 -3
  140. package/src/css/forms/form.css +7 -4
  141. package/src/css/forms/index.css +4 -4
  142. package/src/css/forms/input-icon.css +30 -12
  143. package/src/css/forms/native.css +50 -11
  144. package/src/css/forms/range.css +17 -9
  145. package/src/css/forms/select.css +8 -8
  146. package/src/css/forms/switch.css +14 -12
  147. package/src/css/forms/validation.css +32 -5
  148. package/src/css/grid.css +32 -18
  149. package/src/css/intents.css +2 -2
  150. package/src/css/layout.css +45 -2
  151. package/src/css/optional/aura.css +93 -0
  152. package/src/css/optional/chat.css +105 -0
  153. package/src/css/optional/fab.css +104 -0
  154. package/src/css/optional/floating-field.css +87 -0
  155. package/src/css/optional/index.css +5 -0
  156. package/src/css/optional/layout-extra.css +7 -4
  157. package/src/css/optional/otp.css +115 -0
  158. package/src/css/optional/scroll-snap.css +6 -0
  159. package/src/css/optional/scroller.css +13 -7
  160. package/src/css/optional/typography-fluid.css +5 -0
  161. package/src/css/optional/utilities-extra.css +17 -2
  162. package/src/css/prose.css +18 -8
  163. package/src/css/reset.css +0 -10
  164. package/src/css/theme.css +21 -5
  165. package/src/css/themes/cyberpunk.css +1 -1
  166. package/src/css/themes/dim.css +3 -3
  167. package/src/css/themes/edge.css +8 -10
  168. package/src/css/themes/index.css +8 -4
  169. package/src/css/themes/{dark.css → indigo.css} +5 -4
  170. package/src/css/themes/neon.css +5 -5
  171. package/src/css/themes/square.css +0 -3
  172. package/src/css/tokens.css +74 -20
  173. package/src/css/utilities.css +8 -10
  174. package/src/css/variants.css +51 -66
  175. package/src/js/command.js +1 -3
  176. package/src/js/context-menu.js +67 -35
  177. package/src/js/dialog.js +68 -79
  178. package/src/js/dismiss.js +15 -0
  179. package/src/js/enhance.js +54 -23
  180. package/src/js/enhancement-loader.js +301 -0
  181. package/src/js/events.js +3 -0
  182. package/src/js/filter.js +3 -3
  183. package/src/js/floating.js +101 -131
  184. package/src/js/flyout.js +104 -87
  185. package/src/js/focus-group.js +116 -0
  186. package/src/js/focus.js +6 -1
  187. package/src/js/index.js +4 -2
  188. package/src/js/input.js +1 -1
  189. package/src/js/keys.js +27 -0
  190. package/src/js/mask.js +7 -6
  191. package/src/js/menu.js +87 -34
  192. package/src/js/parse-config.js +47 -0
  193. package/src/js/password.js +9 -1
  194. package/src/js/scrollspy.js +12 -4
  195. package/src/js/selectors.js +0 -7
  196. package/src/js/status.js +3 -1
  197. package/src/js/surface.js +187 -136
  198. package/src/js/tab.js +36 -53
  199. package/src/js/tooltip.js +70 -35
  200. package/src/js/validation.js +34 -8
  201. package/dist/actual.js.map +0 -31
  202. package/docs/README.md +0 -28
  203. package/docs/components.md +0 -860
  204. package/docs/design-notes/previous-work.md +0 -5
  205. package/docs/forms.md +0 -1265
  206. package/docs/javascript.md +0 -496
  207. package/docs/layout.md +0 -480
  208. package/docs/patterns.md +0 -504
  209. package/docs/reserved.md +0 -7
  210. package/docs/tokens.md +0 -455
  211. package/docs/ui.md +0 -929
  212. package/docs/utilities.md +0 -384
  213. package/src/css/dialog-fallback.css +0 -56
  214. package/src/js/dialog-fallback.js +0 -163
package/docs/patterns.md DELETED
@@ -1,504 +0,0 @@
1
- # Patterns
2
-
3
- > Small structural helpers for recurring semantic HTML shapes, between layout primitives and full components.
4
-
5
- Patterns are small structural helpers for recurring semantic HTML shapes. They sit between layout primitives and full components.
6
-
7
- They do not define page layout like `.stack`, `.cluster`, or `.grid`, and they do not provide a strong visual identity like `.alert`, `.card`, or `.btn`.
8
-
9
- Use patterns when a semantic element needs a small amount of normalization before being composed with layout primitives or components.
10
-
11
- ### Principles
12
-
13
- - Layout primitives control spatial behavior.
14
- - Patterns normalize recurring semantic structures.
15
- - Components provide visual identity, states, and interaction styling.
16
- - Prefer composition over one-off component CSS.
17
- - Avoid broad element selectors such as `nav ul` or `.alert menu`.
18
- - A pattern should be useful in more than one component or context.
19
-
20
- ## Actions
21
-
22
- Use `.actions` for a semantic list of actions.
23
-
24
- It removes native list chrome and provides a baseline row layout (`display: flex`, wrap, shared gap). Compose with layout primitives only when you need a different direction or distribution.
25
-
26
- ```html{.stack}
27
- <menu class="actions cluster">
28
- <li><button class="btn primary" type="button">Save</button></li>
29
- <li><button class="btn outline" type="button">Cancel</button></li>
30
- </menu>
31
-
32
- <menu class="actions stack">
33
- <li><a class="btn primary" href="/billing">Update billing</a></li>
34
- <li><a href="/support">Contact support</a></li>
35
- </menu>
36
- ```
37
-
38
- Use `.actions` for:
39
-
40
- - dialog actions
41
- - alert actions
42
- - card actions
43
- - toolbar actions
44
- - form submit/cancel groups
45
-
46
- Use layout primitives for contextual spacing.
47
-
48
- ```html
49
- <div class="alert warning stack">
50
- <p>Your billing method has expired.</p>
51
-
52
- <menu class="actions cluster">
53
- <li><a class="btn danger sm" href="/billing">Update billing</a></li>
54
- <li><a href="/support">Contact support</a></li>
55
- </menu>
56
- </div>
57
- ```
58
-
59
- Prefer composition over making each component reimplement action-list layout.
60
-
61
- ```css
62
- /* Avoid */
63
- .alert > menu {
64
- display: flex;
65
- gap: var(--space-2);
66
- padding: 0;
67
- list-style: none;
68
- }
69
- ```
70
-
71
- ## Navigation List
72
-
73
- Use `.nav-list` for a semantic list of navigation links.
74
-
75
- It removes native list chrome but does not force a direction. Combine it with layout primitives depending on context.
76
-
77
- ```html{.stack}
78
- <h2>Navigation</h2>
79
- <nav aria-label="Main navigation">
80
- <ul class="nav-list cluster">
81
- <li><a href="/docs">Docs</a></li>
82
- <li><a href="/components">Components</a></li>
83
- <li><a href="/examples">Examples</a></li>
84
- </ul>
85
- </nav>
86
- <h2>Documentation</h2>
87
- <nav aria-label="Documentation">
88
- <ul class="nav-list stack">
89
- <li><a href="/docs/getting-started" aria-current="page">Getting started</a></li>
90
- <li><a href="/docs/tokens">Tokens</a></li>
91
- <li><a href="/docs/layout">Layout</a></li>
92
- <li><a href="/docs/components">Components</a></li>
93
- </ul>
94
- </nav>
95
- ```
96
-
97
- Use `.nav-list` for:
98
-
99
- - header navigation
100
- - side navigation
101
- - footer navigation
102
- - tab-like navigation lists
103
- - documentation navigation
104
-
105
- Do not reset every list inside `nav`.
106
-
107
- ```css
108
- /* Avoid */
109
- nav ul {
110
- margin: 0;
111
- padding: 0;
112
- list-style: none;
113
- }
114
- ```
115
-
116
- This is too broad and removes native list behavior from every navigation context, including nested documentation trees or rich content.
117
-
118
- Prefer an explicit pattern class.
119
-
120
- ```html
121
- <nav aria-label="Footer">
122
- <ul class="nav-list cluster">
123
- <li><a href="/privacy">Privacy</a></li>
124
- <li><a href="/terms">Terms</a></li>
125
- <li><a href="/contact">Contact</a></li>
126
- </ul>
127
- </nav>
128
- ```
129
-
130
- ### Header Navigation
131
-
132
- Header navigation is usually a composition of landmarks, layout primitives, and patterns.
133
-
134
- ```html
135
- <header class="site-header">
136
- <div class="center cluster" style="--cluster-justify: space-between">
137
- <a class="brand" href="/">Actual CSS</a>
138
-
139
- <nav aria-label="Main navigation">
140
- <ul class="nav-list cluster">
141
- <li><a href="/docs">Docs</a></li>
142
- <li><a href="/components">Components</a></li>
143
- <li><a href="/examples">Examples</a></li>
144
- </ul>
145
- </nav>
146
- </div>
147
- </header>
148
- ```
149
-
150
- In this example:
151
-
152
- - `header` provides the document landmark.
153
- - `.center` constrains the content.
154
- - `.cluster` arranges the brand and navigation.
155
- - `nav` provides navigation semantics.
156
- - `.nav-list` normalizes the navigation list.
157
- - the inner `.cluster` arranges navigation items horizontally.
158
-
159
- A project may add `.site-header` when it needs a visual shell.
160
-
161
- ```css
162
- .site-header {
163
- border-block-end: 1px solid var(--border);
164
- background: var(--surface);
165
- }
166
- ```
167
-
168
- ### App Shell With Sidebar
169
-
170
- `.app-shell` (see [Layout → Header And Footer](layout.md#header-and-footer)) covers the simple case: a single column stacked `header`/`main`/`footer`. A persistent-sidebar app — a dashboard, an admin panel — needs a second, distinct shape: a two-column grid where the sidebar collapses below a breakpoint. These are not the same primitive solving the same problem two ways; `.app-shell` has no sidebar at all.
171
-
172
- ```html
173
- <div class="shell-sidebar">
174
- <aside class="shell-sidebar-nav" aria-label="Primary">
175
- <a class="navbar-brand" href="#"><span class="avatar primary"><abbr>AC</abbr></span> Product</a>
176
- <nav aria-label="Primary">
177
- <ul class="nav-list stack">
178
- <li><a class="nav-link" href="#" aria-current="page">Overview</a></li>
179
- <li><a class="nav-link" href="#">Settings</a></li>
180
- </ul>
181
- </nav>
182
- </aside>
183
-
184
- <div class="shell-sidebar-main">
185
- <header class="topbar">...</header>
186
- <main class="center">...</main>
187
- </div>
188
- </div>
189
- ```
190
-
191
- ```css
192
- .shell-sidebar {
193
- display: grid;
194
- grid-template-columns: 1fr;
195
- min-block-size: var(--viewport-block);
196
- }
197
-
198
- .shell-sidebar-nav {
199
- display: none;
200
- flex-direction: column;
201
- gap: var(--gap);
202
- inline-size: var(--shell-sidebar-size, 16rem);
203
- padding: var(--space-4);
204
- border-inline-end: var(--border-width) solid var(--border);
205
- background: var(--surface-raised);
206
- }
207
-
208
- .shell-sidebar-main {
209
- min-inline-size: 0;
210
- }
211
-
212
- @media (min-width: 64rem) {
213
- .shell-sidebar {
214
- grid-template-columns: auto minmax(0, 1fr);
215
- }
216
-
217
- .shell-sidebar-nav {
218
- display: flex;
219
- position: sticky;
220
- inset-block-start: 0;
221
- block-size: var(--viewport-block);
222
- overflow-y: auto;
223
- }
224
- }
225
- ```
226
-
227
- The sidebar width is the one tunable a project reaches for often, so it is exposed as `--shell-sidebar-size` rather than hard-coded — override it locally (`style="--shell-sidebar-size: 18rem"` or in a project stylesheet) instead of forking the rule. The breakpoint stays a literal `64rem` in the media query: custom properties cannot be substituted into a media condition, so a project that genuinely needs a different one copies the rule rather than fighting the token.
228
-
229
- Below the breakpoint, mirror the sidebar into a `.drawer` (see [UI → Drawer](ui.md#drawer)) for mobile access — the two are separate elements, not a responsive transform of one.
230
-
231
- ### Side Navigation
232
-
233
- Side navigation is usually a `.nav-list` composed with `.stack`.
234
-
235
- ```html
236
- <aside>
237
- <nav aria-label="Documentation">
238
- <ul class="nav-list stack">
239
- <li><a href="/docs/getting-started" aria-current="page">Getting started</a></li>
240
- <li><a href="/docs/tokens">Tokens</a></li>
241
- <li><a href="/docs/layout">Layout</a></li>
242
- <li><a href="/docs/components">Components</a></li>
243
- </ul>
244
- </nav>
245
- </aside>
246
- ```
247
-
248
- A project may add `.side-nav` only when it needs specific visual behavior such as indentation, sticky positioning, section labels, or active states.
249
-
250
- ```html
251
- <aside class="side-nav">
252
- <nav aria-label="Documentation">
253
- <ul class="nav-list stack">
254
- <li><a href="/docs/getting-started" aria-current="page">Getting started</a></li>
255
- <li><a href="/docs/tokens">Tokens</a></li>
256
- <li><a href="/docs/layout">Layout</a></li>
257
- </ul>
258
- </nav>
259
- </aside>
260
- ```
261
-
262
- ```css
263
- .side-nav {
264
- font-size: var(--font-size-sm);
265
- }
266
-
267
- .side-nav a {
268
- color: inherit;
269
- text-decoration: none;
270
- }
271
-
272
- .side-nav a[aria-current="page"] {
273
- font-weight: 600;
274
- }
275
- ```
276
-
277
- ### Optional Navigation Link Styling
278
-
279
- `.nav-list` can stay purely structural. If the framework wants navigation links to have a default hit area and active state, this can be added as a lightweight visual pattern.
280
-
281
- ```css
282
- .nav-list a {
283
- display: flex;
284
- align-items: center;
285
- gap: var(--space-2);
286
- min-block-size: 2rem;
287
- padding-inline: var(--space-2);
288
- border-radius: var(--radius-sm);
289
- color: inherit;
290
- text-decoration: none;
291
- }
292
-
293
- .nav-list a:hover {
294
- background: var(--surface-subtle);
295
- }
296
-
297
- .nav-list a[aria-current="page"] {
298
- background: var(--surface-subtle);
299
- font-weight: 600;
300
- }
301
- ```
302
-
303
- Keep this separate from layout primitives. `.cluster` and `.stack` should not style links.
304
-
305
- ## Icon Input
306
-
307
- Use `.input-icon` for a search or filter input with a leading icon.
308
-
309
- ```html
310
- <label class="input-icon">
311
- <i class="ti ti-search" aria-hidden="true"></i>
312
- <input class="input" type="search" placeholder="Search accounts, invoices, notes" aria-label="Search">
313
- </label>
314
- ```
315
-
316
- It positions the wrapper's first child absolutely inside a relative container and grows the input's start padding to clear it. `pointer-events: none` on the icon keeps clicks passing through to the input underneath. It is icon-library agnostic — an `<i>` webfont icon, an inline `<svg>`, or a `<span>` all work as the wrapper's first child.
317
-
318
- The icon is sized with `--variant-icon-size` (variants.css), the same token `.alert` uses, so `.sm`/`.lg` scale it automatically. Apply the size class to the wrapper so the icon picks it up, and to the input so its own height/font-size follow:
319
-
320
- ```html{.stack}
321
- <label class="input-icon sm">
322
- <i class="ti ti-search" aria-hidden="true"></i>
323
- <input class="input sm" type="search" aria-label="Search">
324
- </label>
325
- ```
326
-
327
- Trailing icons (e.g. a clear button) aren't covered by this class — it only handles the leading case.
328
-
329
- ## Structured Lists
330
-
331
- Use native lists plus layout primitives for rich content rows. Reset list chrome only when markers are not part of the content.
332
-
333
- ```html
334
- <figure class="stack">
335
- <figcaption><strong>Most played songs this week</strong></figcaption>
336
-
337
- <ul class="list-reset stack gap-none">
338
- <li class="media items-center py" style="border-block-end: var(--border-width) solid var(--border)">
339
- <div class="avatar">
340
- <img src="https://i.pravatar.cc/48?img=5" alt="Dio Lupa" />
341
- </div>
342
- <div class="cluster">
343
- <div class="stack grow" style="--gap: var(--space-1)">
344
- <strong>Dio Lupa</strong>
345
- <span class="muted">Remaining Reason</span>
346
- </div>
347
- <span class="muted">3:45</span>
348
- <button class="btn ghost" type="button" aria-label="Play">
349
- <i class="ti ti-player-play" aria-hidden="true"></i>
350
- </button>
351
- </div>
352
- </li>
353
-
354
- <li class="media items-center py" style="border-block-end: var(--border-width) solid var(--border)">
355
- <div class="avatar">
356
- <img src="https://i.pravatar.cc/48?img=10" alt="Astral Planes" />
357
- </div>
358
- <div class="cluster">
359
- <div class="stack grow" style="--gap: var(--space-1)">
360
- <strong>Astral Planes</strong>
361
- <span class="muted">Neon Drift</span>
362
- </div>
363
- <span class="muted">4:12</span>
364
- <button class="btn ghost" type="button" aria-label="Play">
365
- <i class="ti ti-player-play" aria-hidden="true"></i>
366
- </button>
367
- </div>
368
- </li>
369
- </ul>
370
- </figure>
371
- ```
372
-
373
- Use `.actions` for action controls and `.nav-list` for navigation links. For structured content items, compose `.list-reset`, `.stack`, `.cluster`, `.media`, and components directly.
374
-
375
- `.media` is a two-slot object: it lays out exactly two children — the leading element and one content column. Trailing metadata and actions belong inside the content column (nest a `.cluster` and put `.grow` on the flexible part), never as extra row children: additional children silently wrap onto a second grid row.
376
-
377
- ## Relationship With Layout
378
-
379
- Patterns often compose with layout primitives.
380
-
381
- ```html
382
- <menu class="actions cluster">...</menu>
383
- <ul class="nav-list cluster">...</ul>
384
- <ul class="nav-list stack">...</ul>
385
- <section class="grid">...</section>
386
- ```
387
-
388
- Avoid putting semantic resets into layout primitives.
389
-
390
- ```css
391
- /* Avoid */
392
- .stack {
393
- padding: 0;
394
- list-style: none;
395
- }
396
- ```
397
-
398
- `.stack` should remain useful for real content lists where markers are expected.
399
-
400
- ```html
401
- <ul class="stack">
402
- <li>First important point</li>
403
- <li>Second important point</li>
404
- <li>Third important point</li>
405
- </ul>
406
- ```
407
-
408
- If list chrome should be removed, use an explicit pattern.
409
-
410
- ```html
411
- <ul class="nav-list stack">
412
- <li><a href="/docs">Docs</a></li>
413
- <li><a href="/components">Components</a></li>
414
- </ul>
415
- ```
416
-
417
- ## Hierarchical scrollable nav
418
-
419
- App shell with a collapsible nav tree. Uses existing primitives only — no
420
- treeview component.
421
-
422
- ```html
423
- <aside class="sidebar">
424
- <nav class="nav-list scroller" data-enhance="scrollspy" aria-label="Docs">
425
- <details open>
426
- <summary class="nav-heading">Getting started</summary>
427
- <a class="nav-link" href="#intro">Introduction</a>
428
- <a class="nav-link" href="#install">Installation</a>
429
- </details>
430
- <details>
431
- <summary class="nav-heading">Components</summary>
432
- <a class="nav-link" href="#alert">Alert</a>
433
- <a class="nav-link" href="#badge">Badge</a>
434
- </details>
435
- </nav>
436
- </aside>
437
- ```
438
-
439
- - `.nav-list` + `.nav-link`: Actual's nav chrome
440
- - Native `<details>`: exclusive accordion with `<details name>` (no JS engine)
441
- - `data-enhance="scrollspy"`: scroll-driven `aria-current`
442
- - `.scroller`: thin, theme-aware scrollbar
443
- - No `.nav-heading` / `.nav-sublist` classes — the existing primitives are enough
444
-
445
- ## Code block with copy button
446
-
447
- ```html
448
- <div class="code-block">
449
- <pre><code>npm install actual-css</code></pre>
450
- <button class="btn sm ghost" data-copy>Copy</button>
451
- </div>
452
- ```
453
-
454
- ```css
455
- .code-block { position: relative; }
456
- .code-block > [data-copy] {
457
- position: absolute;
458
- inset-block-start: var(--space-2);
459
- inset-inline-end: var(--space-2);
460
- }
461
- ```
462
-
463
- ```js
464
- import enhance from "actual-css/js/enhance";
465
-
466
- enhance({
467
- "[data-copy]": (button) => {
468
- const controller = new AbortController();
469
- button.addEventListener("click", async () => {
470
- const code = button.closest(".code-block")?.querySelector("code");
471
- if (code) await navigator.clipboard.writeText(code.textContent);
472
- }, { signal: controller.signal });
473
- return () => controller.abort();
474
- },
475
- });
476
- ```
477
-
478
- No core JS, no syntax highlighter — the recipe is the documentation.
479
-
480
- ## `<details name>` exclusive accordion
481
-
482
- Browsers that support the `name` attribute on `<details>` get native exclusive
483
- accordions — no JS engine needed. Omit `name` to allow several open at once.
484
-
485
- ```html
486
- <details name="faq" open>
487
- <summary>What is this?</summary>
488
- <p>A CSS framework.</p>
489
- </details>
490
- <details name="faq">
491
- <summary>Does it need JS?</summary>
492
- <p>Only the progressive enhancers you import.</p>
493
- </details>
494
- ```
495
-
496
- Not shipping an accordion JS engine is a design decision, not a gap.
497
-
498
- ## Intent nesting
499
-
500
- Intent on an ancestor must not tint nested components, and a local intent inside
501
- an intent-carrying ancestor must win. Both directions are verified in
502
- `tests/css-audit.test.js` and the kitchen-sink demo template. Every
503
- intent-consuming component must declare its `@sync intent-boundary` block —
504
- that is what prevents inheritance from leaking across components.
package/docs/reserved.md DELETED
@@ -1,7 +0,0 @@
1
- # Reserved classes
2
-
3
- ## Reserved classes
4
-
5
- These CSS class names are reserved by Actual CSS. Do not reuse them in your own stylesheets — they are part of the public API and may be extended in future versions.
6
-
7
- <!-- reserved-classes list is auto-generated from scripts/reserved-classes.json -->