actual-css 0.4.2 → 0.6.0
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/CHANGELOG.md +66 -3
- package/README.md +2 -2
- package/dist/actual.css +54 -14
- package/dist/actual.full.css +744 -185
- package/dist/actual.full.js +1 -1
- package/dist/actual.full.min.css +1 -1
- package/dist/actual.min.css +1 -1
- package/docs/design-notes/browser-support.md +14 -14
- package/docs/design-notes/enhancement-contract.md +30 -13
- package/docs/design-notes/forced-colors.md +11 -7
- package/docs/design-notes/grid.md +4 -4
- package/docs/design-notes/naming.md +15 -9
- package/docs/design-notes/platform-alignment.md +9 -0
- package/docs/design-notes/references.md +4 -0
- package/docs/design-notes/spacing-units.md +286 -0
- package/docs/design-notes/steps.md +748 -0
- package/docs/design-notes/widget-primitives.md +32 -15
- package/docs/navigation.json +2 -0
- package/docs/pages/components/alert.md +14 -9
- package/docs/pages/components/app-navigation.md +2 -0
- package/docs/pages/components/aura.md +102 -6
- package/docs/pages/components/avatar.md +9 -6
- package/docs/pages/components/badge.md +27 -9
- package/docs/pages/components/button.md +25 -18
- package/docs/pages/components/card.md +27 -7
- package/docs/pages/components/chat.md +1 -1
- package/docs/pages/components/data-list.md +72 -0
- package/docs/pages/components/dialog.md +12 -7
- package/docs/pages/components/drawer.md +3 -1
- package/docs/pages/components/fab.md +14 -10
- package/docs/pages/components/indicator.md +6 -6
- package/docs/pages/components/list.md +11 -2
- package/docs/pages/components/meter.md +56 -1
- package/docs/pages/components/navbar.md +1 -1
- package/docs/pages/components/pagination.md +1 -1
- package/docs/pages/components/progress.md +10 -0
- package/docs/pages/components/rating.md +4 -4
- package/docs/pages/components/skeleton.md +3 -1
- package/docs/pages/components/spinner.md +1 -1
- package/docs/pages/components/steps.md +379 -47
- package/docs/pages/components/table.md +6 -5
- package/docs/pages/enhancements/flyout.md +14 -10
- package/docs/pages/enhancements/overview.md +2 -2
- package/docs/pages/enhancements/scrollspy.md +1 -1
- package/docs/pages/enhancements/status-bar.md +10 -1
- package/docs/pages/enhancements/tabs.md +1 -1
- package/docs/pages/examples/overview.md +4 -1
- package/docs/pages/forms/choice-cards.md +4 -4
- package/docs/pages/forms/combobox.md +87 -0
- package/docs/pages/forms/floating-field.md +5 -3
- package/docs/pages/forms/joined-controls.md +6 -4
- package/docs/pages/forms/labels.md +8 -5
- package/docs/pages/forms/overview.md +26 -19
- package/docs/pages/forms/password.md +3 -2
- package/docs/pages/forms/range.md +15 -2
- package/docs/pages/forms/states-and-sizes.md +7 -5
- package/docs/pages/forms/validation.md +15 -9
- package/docs/pages/foundations/philosophy.md +11 -1
- package/docs/pages/foundations/tokens.md +16 -9
- package/docs/pages/foundations/typography.md +11 -3
- package/docs/pages/guides/bootstrap.md +3 -3
- package/docs/pages/guides/introduction.md +2 -2
- package/docs/pages/guides/modular-import.md +21 -10
- package/docs/pages/guides/progressive-enhancement.md +75 -54
- package/docs/pages/guides/tailwind.md +2 -2
- package/docs/pages/layout/app-shell.md +4 -4
- package/docs/pages/layout/choosing.md +10 -6
- package/docs/pages/layout/grid.md +11 -10
- package/docs/pages/layout/scroll-snap.md +2 -0
- package/docs/pages/layout/sidebar-layout.md +2 -0
- package/docs/pages/layout/stack.md +10 -6
- package/docs/pages/layout/topbar.md +2 -0
- package/docs/pages/patterns/structured-lists.md +7 -7
- package/docs/pages/utilities/accessibility.md +19 -1
- package/docs/pages/utilities/flex.md +20 -13
- package/docs/pages/utilities/links.md +1 -1
- package/docs/pages/utilities/list.md +1 -1
- package/docs/pages/utilities/overflow.md +14 -7
- package/docs/pages/utilities/overview.md +22 -0
- package/docs/pages/utilities/shape.md +1 -1
- package/docs/pages/utilities/sizing-wrapping.md +10 -8
- package/docs/pages/utilities/spacing.md +26 -19
- package/docs/pages/utilities/text.md +1 -1
- package/llms.txt +27 -4
- package/package.json +3 -2
- package/scripts/reserved-classes.json +8 -1
- package/src/css/components/data-list.css +27 -0
- package/src/css/components/drawer.css +30 -11
- package/src/css/components/fab.css +44 -8
- package/src/css/components/flyout.css +17 -12
- package/src/css/components/index.css +1 -0
- package/src/css/components/list.css +3 -1
- package/src/css/components/meter.css +28 -1
- package/src/css/components/modal.css +28 -11
- package/src/css/components/progress.css +5 -0
- package/src/css/components/status-bar.css +31 -15
- package/src/css/components/steps.css +289 -55
- package/src/css/components/surface.css +5 -3
- package/src/css/components/tooltip.css +5 -8
- package/src/css/core/base.css +7 -1
- package/src/css/core/intents.css +6 -0
- package/src/css/core/tokens.css +24 -9
- package/src/css/core/variants.css +17 -4
- package/src/css/effects/aura.css +101 -11
- package/src/css/forms/custom-select.css +1 -1
- package/src/css/forms/floating-field.css +8 -6
- package/src/css/forms/form.css +4 -4
- package/src/css/layout/container-query.css +37 -13
- package/src/css/layout/grid.css +7 -7
- package/src/css/layout/index.css +1 -1
- package/src/css/typography/prose.css +2 -3
- package/src/css/utilities/base.css +16 -0
- package/src/js/password.js +1 -1
- package/src/js/selectors.js +1 -0
- package/src/js/status.js +88 -7
- package/src/js/surface.js +2 -11
- package/src/js/transition.js +20 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> The optional JavaScript runtime that progressively enhances Actual's semantic markup — self-registering side-effect modules, the `enhance()` DOM lifecycle, stateless command routing, and the floating and surface contracts for custom widgets.
|
|
4
4
|
|
|
5
5
|
Actual's JavaScript modules are optional. Importing `actual-css/js/full`
|
|
6
|
-
registers the
|
|
6
|
+
registers the full runtime — every built-in enhancer, including
|
|
7
7
|
validation and status. Importing `actual-css/js` registers only the enhancement
|
|
8
8
|
manifest loader; importing a specific module registers only that behavior. The
|
|
9
9
|
runtime does not require `DOMContentLoaded` or manual init calls, and it never
|
|
@@ -18,7 +18,7 @@ runtime evolves. The runtime assumes the modern platform primitives available
|
|
|
18
18
|
across Minimal and ships no compatibility layer or polyfill.
|
|
19
19
|
|
|
20
20
|
| Tier | Firefox | Safari | Chromium |
|
|
21
|
-
|
|
21
|
+
| ------------ | ------- | --------- | -------- |
|
|
22
22
|
| Degraded | 78+ | 14+ | 88+ |
|
|
23
23
|
| **Minimal** | **98+** | **15.4+** | **99+** |
|
|
24
24
|
| Intermediate | 121+ | 16+ | 106+ |
|
|
@@ -56,7 +56,7 @@ Modules are safe to import during SSR — registration is a no-op when there is
|
|
|
56
56
|
DOM. The runtime remains active until the page unloads; there is no teardown
|
|
57
57
|
handle, and cleanup happens per element when an element leaves the DOM.
|
|
58
58
|
|
|
59
|
-
## The
|
|
59
|
+
## The full runtime
|
|
60
60
|
|
|
61
61
|
Loading `dist/actual.full.js` as a plain `<script>` (no `type="module"`, no
|
|
62
62
|
bundler, no `import`) gets the full runtime. Static HTML that needs to trigger
|
|
@@ -74,22 +74,25 @@ example:
|
|
|
74
74
|
</script>
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
| Module | Behavior
|
|
78
|
-
|
|
79
|
-
| `actual-css/js/flyout` | Trigger → panel
|
|
80
|
-
| `actual-css/js/context-menu` | Context menus on `data-context-menu`
|
|
81
|
-
| `actual-css/js/focus-group` | Reusable roving-focus controller; no automatic discovery
|
|
82
|
-
| `actual-css/js/dialog` | Native `<dialog>` behavior, focus management, dismissal
|
|
83
|
-
| `actual-css/js/dismiss` | The generic `--dismiss` command
|
|
84
|
-
| `actual-css/js/tab` | Tab panels and arrow-key navigation (token `tabs`)
|
|
85
|
-
| `actual-css/js/tooltip` | Tooltips on `data-tooltip`
|
|
86
|
-
| `actual-css/js/scrollspy` | Scroll-driven nav highlighting (token `scrollspy`)
|
|
87
|
-
| `actual-css/js/filter` | Input value filtering on `data-filter`
|
|
88
|
-
| `actual-css/js/mask` | Input masks on `data-mask`
|
|
89
|
-
| `actual-css/js/password` | Password reveal toggle
|
|
90
|
-
| `actual-css/js/validation` | Form validation (token `validation`)
|
|
91
|
-
| `actual-css/js/status` | Singleton status bar on `[data-status][role="status"]`
|
|
92
|
-
| `actual-css/js/enhancement-loader` | Declared enhancement manifests
|
|
77
|
+
| Module | Behavior |
|
|
78
|
+
| ---------------------------------- | ----------------------------------------------------------- |
|
|
79
|
+
| `actual-css/js/flyout` | Trigger → panel positioning and open/close (token `flyout`) |
|
|
80
|
+
| `actual-css/js/context-menu` | Context menus on `data-context-menu` |
|
|
81
|
+
| `actual-css/js/focus-group` | Reusable roving-focus controller; no automatic discovery |
|
|
82
|
+
| `actual-css/js/dialog` | Native `<dialog>` behavior, focus management, dismissal |
|
|
83
|
+
| `actual-css/js/dismiss` | The generic `--dismiss` command |
|
|
84
|
+
| `actual-css/js/tab` | Tab panels and arrow-key navigation (token `tabs`) |
|
|
85
|
+
| `actual-css/js/tooltip` | Tooltips on `data-tooltip` |
|
|
86
|
+
| `actual-css/js/scrollspy` | Scroll-driven nav highlighting (token `scrollspy`) |
|
|
87
|
+
| `actual-css/js/filter` | Input value filtering on `data-filter` |
|
|
88
|
+
| `actual-css/js/mask` | Input masks on `data-mask` |
|
|
89
|
+
| `actual-css/js/password` | Password reveal toggle |
|
|
90
|
+
| `actual-css/js/validation` | Form validation (token `validation`) |
|
|
91
|
+
| `actual-css/js/status` | Singleton status bar on `[data-status][role="status"]` |
|
|
92
|
+
| `actual-css/js/enhancement-loader` | Declared enhancement manifests |
|
|
93
|
+
|
|
94
|
+
The enhancement loader reads its manifests from `data-enhance-modules` or the
|
|
95
|
+
`Enhance-Modules` header.
|
|
93
96
|
|
|
94
97
|
Use `actual-css/js/full` for demos, playgrounds, and smoke tests where one import
|
|
95
98
|
enables every built-in behavior. Production apps can import individual modules
|
|
@@ -125,7 +128,7 @@ see the widget-primitives design note. Every primitive subpath is published in
|
|
|
125
128
|
`package.json#exports`:
|
|
126
129
|
|
|
127
130
|
| Subpath | Purpose |
|
|
128
|
-
|
|
131
|
+
| ------------------------ | ---------------------------------------------------------------- |
|
|
129
132
|
| `actual-css/js/enhance` | DOM lifecycle engine: `enhance()`, `registerEnhancement`, tokens |
|
|
130
133
|
| `actual-css/js/escape` | Per-document LIFO Escape dismissal stack |
|
|
131
134
|
| `actual-css/js/events` | The `actual:*` event name constants |
|
|
@@ -155,14 +158,16 @@ const stop = autoUpdate(float, () => {
|
|
|
155
158
|
|
|
156
159
|
Options passed to `reposition()`:
|
|
157
160
|
|
|
158
|
-
| Option | Default | Contract
|
|
159
|
-
|
|
160
|
-
| `placement` | `"bottom-start"` | Preferred side and alignment
|
|
161
|
-
| `distance` | `0` | Gap
|
|
162
|
-
| `flip` | `true` | Flip
|
|
163
|
-
| `shift` | `true` | Shift along the main axis to stay
|
|
164
|
-
| `shiftPadding` | `4` | Minimum space kept from the boundary
|
|
165
|
-
| `scope` | viewport | Boundary element for overflow decisions
|
|
161
|
+
| Option | Default | Contract |
|
|
162
|
+
| -------------- | ---------------- | ------------------------------------------- |
|
|
163
|
+
| `placement` | `"bottom-start"` | Preferred side and alignment |
|
|
164
|
+
| `distance` | `0` | Gap from the reference element |
|
|
165
|
+
| `flip` | `true` | Flip when the preferred side is out of view |
|
|
166
|
+
| `shift` | `true` | Shift along the main axis to stay in bounds |
|
|
167
|
+
| `shiftPadding` | `4` | Minimum space kept from the boundary |
|
|
168
|
+
| `scope` | viewport | Boundary element for overflow decisions |
|
|
169
|
+
|
|
170
|
+
`placement` takes a `-start` or `-end` alignment suffix.
|
|
166
171
|
|
|
167
172
|
`autoUpdate(element, callback)` batches scroll, resize, and element-resize
|
|
168
173
|
callbacks per document and returns a stop handle; it does not keep a closed or
|
|
@@ -206,22 +211,33 @@ visible dismissable UI to the shared per-document Escape stack.
|
|
|
206
211
|
widgets can veto or decorate opens, and context menus inject their own
|
|
207
212
|
`source`/`restoreFocusTo` through it.
|
|
208
213
|
|
|
209
|
-
| Option | Default
|
|
210
|
-
|
|
211
|
-
| `trigger` | —
|
|
212
|
-
| `source` | —
|
|
213
|
-
| `x`, `y` | —
|
|
214
|
-
| `placement` | `"bottom-start"`
|
|
215
|
-
| `distance` | `4`
|
|
216
|
-
| `flip` | `true`
|
|
217
|
-
| `shift` | `true`
|
|
218
|
-
| `shiftPadding` | `4`
|
|
219
|
-
| `scope` | viewport
|
|
220
|
-
| `mobile` | `"auto"`
|
|
221
|
-
| `breakpoint` | `768`
|
|
222
|
-
| `autoClose` | `"outside"`
|
|
223
|
-
| `dismissOnScroll` | `false`
|
|
224
|
-
| `restoreFocusTo` | `trigger`
|
|
214
|
+
| Option | Default | Contract |
|
|
215
|
+
| ----------------- | ---------------- | ------------------------------------------- |
|
|
216
|
+
| `trigger` | — | Anchoring element, and focus-restore target |
|
|
217
|
+
| `source` | — | Alternate anchor when there is no trigger |
|
|
218
|
+
| `x`, `y` | — | Position at a fixed viewport point |
|
|
219
|
+
| `placement` | `"bottom-start"` | Preferred placement |
|
|
220
|
+
| `distance` | `4` | Gap between anchor and surface |
|
|
221
|
+
| `flip` | `true` | Flip when the preferred side is hidden |
|
|
222
|
+
| `shift` | `true` | Shift to stay within the boundary |
|
|
223
|
+
| `shiftPadding` | `4` | Minimum space kept from the boundary |
|
|
224
|
+
| `scope` | viewport | Boundary element |
|
|
225
|
+
| `mobile` | `"auto"` | Sheet behavior |
|
|
226
|
+
| `breakpoint` | `768` | Max viewport width for an automatic sheet |
|
|
227
|
+
| `autoClose` | `"outside"` | Which clicks close the surface |
|
|
228
|
+
| `dismissOnScroll` | `false` | Close on a scroll the user just started |
|
|
229
|
+
| `restoreFocusTo` | `trigger` | Element focused on close |
|
|
230
|
+
|
|
231
|
+
`x`, `y` replace the anchor entirely, which is what a context menu needs.
|
|
232
|
+
`mobile` takes `"auto"`, `"sheet"`, `"none"` or `"anchored"`.
|
|
233
|
+
|
|
234
|
+
`autoClose` takes `"true"` to close on inside and outside clicks, `"inside"` or
|
|
235
|
+
`"outside"` to limit it to one side, and `"false"` to disable automatic click
|
|
236
|
+
closing; an invalid value reads as `"true"`.
|
|
237
|
+
|
|
238
|
+
`dismissOnScroll` only fires when the scroll follows a new user input — the
|
|
239
|
+
scroll that opening or focusing causes is ignored. `restoreFocusTo` falls back
|
|
240
|
+
to `source` when there is no `trigger`.
|
|
225
241
|
|
|
226
242
|
The click policy belongs to the surface rather than to a particular menu
|
|
227
243
|
anatomy. The generic primitive defaults to outside-click dismissal; flyout and
|
|
@@ -242,14 +258,18 @@ The runtime dispatches a small set of public `actual:*` events. All are
|
|
|
242
258
|
listenable on the document; cancelable events veto the associated action when
|
|
243
259
|
`preventDefault()` is called.
|
|
244
260
|
|
|
245
|
-
| Event | Dispatch
|
|
246
|
-
|
|
247
|
-
| `actual:surface-open` |
|
|
248
|
-
| `actual:context-menu` |
|
|
249
|
-
| `actual:status` | status module, or any code
|
|
250
|
-
| `actual:invalid` |
|
|
251
|
-
| `actual:dialog-cancel` |
|
|
252
|
-
| `actual:dismiss` | `--dismiss`
|
|
261
|
+
| Event | Dispatch | `detail` |
|
|
262
|
+
| ---------------------- | ------------------------------ | ------------------------------------ |
|
|
263
|
+
| `actual:surface-open` | before a surface opens | `{ surface, options }` |
|
|
264
|
+
| `actual:context-menu` | before a context menu opens | `{ menu, context, origin, trigger }` |
|
|
265
|
+
| `actual:status` | status module, or any code | `{ message, intent, duration }` |
|
|
266
|
+
| `actual:invalid` | after a submit was blocked | `{ form, firstInvalid, message }` |
|
|
267
|
+
| `actual:dialog-cancel` | before a native cancel close | `{ dialog, sourceEvent }` |
|
|
268
|
+
| `actual:dismiss` | after `--dismiss` hid a target | `{ trigger }` |
|
|
269
|
+
|
|
270
|
+
`actual:surface-open`, `actual:context-menu` and `actual:dialog-cancel` are
|
|
271
|
+
cancelable. `actual:status` both shows and clears the status bar — omit
|
|
272
|
+
`message` to clear it.
|
|
253
273
|
|
|
254
274
|
## Extending the runtime
|
|
255
275
|
|
|
@@ -388,7 +408,8 @@ import { loadEnhancement, loadEnhancements, loadResponse } from "actual-css/js/e
|
|
|
388
408
|
|
|
389
409
|
await loadEnhancements(); // every manifest block in the document
|
|
390
410
|
await loadEnhancement("autosubmit", "/js/autosubmit.js");
|
|
391
|
-
await
|
|
411
|
+
const response = await fetch("/...");
|
|
412
|
+
await loadResponse(response); // Enhance-Modules header
|
|
392
413
|
```
|
|
393
414
|
|
|
394
415
|
The `Enhance-Modules` HTTP header carries the same JSON object. Loaded modules
|
|
@@ -638,7 +659,7 @@ enhance({
|
|
|
638
659
|
|
|
639
660
|
## Form validation
|
|
640
661
|
|
|
641
|
-
`actual-css/js/validation` is part of the
|
|
662
|
+
`actual-css/js/validation` is part of the full runtime and also importable on
|
|
642
663
|
its own — it is an enhancer, not a validation framework. Forms opt in with the
|
|
643
664
|
`data-enhance="validation"` token (`.needs-validation` is a presentation class
|
|
644
665
|
for CSS-only `:user-invalid` feedback and does not by itself register the
|
|
@@ -205,7 +205,7 @@ Actual does not prohibit media queries. It simply does not encode every media qu
|
|
|
205
205
|
## Utility translation guide
|
|
206
206
|
|
|
207
207
|
| Tailwind usage | Actual approach |
|
|
208
|
-
|
|
208
|
+
| ------------------------------------ | ------------------------------------------------- |
|
|
209
209
|
| `flex flex-col gap-*` | `.stack` |
|
|
210
210
|
| `flex flex-wrap items-center gap-*` | `.cluster` |
|
|
211
211
|
| `grid grid-cols-*` | `.grid`, `.grid-2`, `.grid-3`, etc. |
|
|
@@ -407,7 +407,7 @@ Do not remove Tailwind from the build until migrated screens no longer depend on
|
|
|
407
407
|
## Where migration is genuinely harder
|
|
408
408
|
|
|
409
409
|
| Existing Tailwind usage | Migration cost |
|
|
410
|
-
|
|
410
|
+
| -------------------------------------------------- | -------------- |
|
|
411
411
|
| buttons, badges, alerts, forms | low |
|
|
412
412
|
| repeated card/panel patterns | low |
|
|
413
413
|
| basic flex/grid composition | low to medium |
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# App Shell
|
|
2
2
|
|
|
3
|
-
Full-height, single-column document flow.
|
|
4
|
-
|
|
3
|
+
Full-height, single-column document flow. Use it as the outer shell for ordinary pages,
|
|
4
|
+
simple applications, and other layouts that need a header / main / footer structure spanning the viewport.
|
|
5
5
|
|
|
6
6
|
Header and footer are document landmarks, not required layout classes.
|
|
7
|
-
Use semantic elements by default.
|
|
8
|
-
|
|
7
|
+
Use semantic elements by default. .app-shell already supplies the outer column,
|
|
8
|
+
so do not add a .stack solely to arrange the page landmarks.
|
|
9
9
|
|
|
10
10
|
```html demo
|
|
11
11
|
<body class="app-shell">
|
|
@@ -5,10 +5,14 @@ number of children visible in one mockup.
|
|
|
5
5
|
|
|
6
6
|
## Page and application shells
|
|
7
7
|
|
|
8
|
-
| Situation
|
|
9
|
-
|
|
10
|
-
|
|
|
11
|
-
|
|
|
8
|
+
| Situation | Recipe |
|
|
9
|
+
| -------------------------------------- | ------------------------------------------- |
|
|
10
|
+
| A normally scrolling page | Semantic landmarks, optionally `.app-shell` |
|
|
11
|
+
| Topbar + scrolling main + adaptive nav | `.app-layout` |
|
|
12
|
+
|
|
13
|
+
The first covers public, marketing and editorial pages; add `.navbar` for site
|
|
14
|
+
navigation. The second is `.app-layout` with its exact direct-child contract,
|
|
15
|
+
where the primary navigation moves from bottom to side.
|
|
12
16
|
|
|
13
17
|
Do not choose `.app-layout` from the word "app" or from the presence of a
|
|
14
18
|
header. Its viewport-sized grid, hidden shell overflow, internal main scroll,
|
|
@@ -19,11 +23,11 @@ below.
|
|
|
19
23
|
## Content relationships
|
|
20
24
|
|
|
21
25
|
| Situation | Primitive |
|
|
22
|
-
|
|
26
|
+
| ------------------------------------------------------------ | ----------------- |
|
|
23
27
|
| Vertical flow | `.stack` |
|
|
24
28
|
| Inline actions, tags, or navigation that may wrap | `.cluster` |
|
|
25
29
|
| Responsive collection; an incomplete final row is acceptable | `.grid` |
|
|
26
|
-
| Known structural density, at most N columns
|
|
30
|
+
| Known structural density, at most N columns | `.grid-N` |
|
|
27
31
|
| Peer regions that must switch together | `.switcher` |
|
|
28
32
|
| Main content followed by a secondary region | `.sidebar-layout` |
|
|
29
33
|
| Fixed media followed by flexible content | `.media` |
|
|
@@ -12,7 +12,7 @@ column count.
|
|
|
12
12
|
`.grid` fits as many columns as the available inline space permits. Incomplete
|
|
13
13
|
final rows are part of the contract.
|
|
14
14
|
|
|
15
|
-
```html demo
|
|
15
|
+
```html demo resize
|
|
16
16
|
<section class="grid">
|
|
17
17
|
<article class="card"><h3>Starter</h3><p>For small projects.</p></article>
|
|
18
18
|
<article class="card"><h3>Team</h3><p>For shared products.</p></article>
|
|
@@ -34,7 +34,7 @@ Tune the item minimum with `--grid-min`.
|
|
|
34
34
|
own: it never exceeds N columns, never overflows, and every item keeps the same
|
|
35
35
|
width.
|
|
36
36
|
|
|
37
|
-
```html demo
|
|
37
|
+
```html demo resize
|
|
38
38
|
<div class="grid-4">
|
|
39
39
|
<div class="card">Exercitation</div>
|
|
40
40
|
<div class="card">Amet mollit</div>
|
|
@@ -47,7 +47,7 @@ width.
|
|
|
47
47
|
density is `.grid-N`'s. Choose the preset that suits your item size:
|
|
48
48
|
|
|
49
49
|
| Item | Preset |
|
|
50
|
-
|
|
50
|
+
| --------------------------------- | -------------------- |
|
|
51
51
|
| large card | `.grid-2` |
|
|
52
52
|
| card with a heading and a summary | `.grid-3`, `.grid-4` |
|
|
53
53
|
| compact tile, stat, avatar | `.grid-6` |
|
|
@@ -56,9 +56,9 @@ density is `.grid-N`'s. Choose the preset that suits your item size:
|
|
|
56
56
|
|
|
57
57
|
Left alone, a preset collapses one column at a time, so a six-item `.grid-6`
|
|
58
58
|
can pass through five columns — five items and a lone sixth. The example above
|
|
59
|
-
is that bare version. Placed inside a container named **`actual-
|
|
59
|
+
is that bare version. Placed inside a container named **`actual-container`** — the
|
|
60
60
|
`.container-query` helper, or a region of your own that declares
|
|
61
|
-
`container: actual-
|
|
61
|
+
`container: actual-container / inline-size` — it only ever enters a **divisor of N**:
|
|
62
62
|
|
|
63
63
|
```text
|
|
64
64
|
.grid-2 2 → 1
|
|
@@ -69,7 +69,7 @@ is that bare version. Placed inside a container named **`actual-grid`** — the
|
|
|
69
69
|
|
|
70
70
|
Every state splits the collection evenly, and all items keep the same width.
|
|
71
71
|
|
|
72
|
-
```html demo
|
|
72
|
+
```html demo resize
|
|
73
73
|
<div class="container-query">
|
|
74
74
|
<div class="grid-6">
|
|
75
75
|
<div class="card">1</div>
|
|
@@ -89,7 +89,7 @@ not the grid's own width. Padding and borders on the container come off before
|
|
|
89
89
|
the query resolves.
|
|
90
90
|
|
|
91
91
|
| Container content box | `.grid-2` | `.grid-3` | `.grid-4` | `.grid-6` |
|
|
92
|
-
|
|
92
|
+
| --------------------- | --------- | --------- | --------- | --------- |
|
|
93
93
|
| under `28rem` | 1 | 1 | 1 | 1 |
|
|
94
94
|
| `28rem` to `48rem` | 2 | 1 | 2 | 2 |
|
|
95
95
|
| `48rem` to `64rem` | 2 | 3 | 2 | 3 |
|
|
@@ -113,9 +113,10 @@ change cannot drop the region a state.
|
|
|
113
113
|
|
|
114
114
|
Balanced subdivision is precision, never a prerequisite for responsive
|
|
115
115
|
behavior — forgetting the container costs you the exact chain, nothing else.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
`actual-container` is the framework's shared name for size-aware components,
|
|
117
|
+
so one region can serve a grid and a step flow at once. The grid responds only
|
|
118
|
+
to that name, never to an incidental query container, so a region that sets
|
|
119
|
+
`container-type: inline-size` for its own reasons leaves the grid untouched. The container has to be an
|
|
119
120
|
ancestor: an element cannot query its own size without taking inline-size
|
|
120
121
|
containment, which would collapse the grid inside a `.cluster`, a float, or any
|
|
121
122
|
shrink-to-fit box. Put it on a normal block-level wrapper for the same reason.
|
|
@@ -6,6 +6,8 @@ Horizontal rails that stay useful without JavaScript and snap in modern browsers
|
|
|
6
6
|
|
|
7
7
|
Use `.scroll-snap` for a niche row of items that should scroll horizontally, such as card rails, media strips, overflow tabs, or a simple touch-friendly carousel baseline. Scrolling only appears when the items are wider than the container; set `--scroll-snap-item-size` for card rails.
|
|
8
8
|
|
|
9
|
+
**Related terms:** carousel, card carousel, horizontal scroller, media rail, scrolling rail.
|
|
10
|
+
|
|
9
11
|
```html demo
|
|
10
12
|
<section class="stack" aria-labelledby="featured-title">
|
|
11
13
|
<h2 id="featured-title">Featured articles</h2>
|
|
@@ -5,6 +5,8 @@ switches intrinsically according to its own available width: the regions sit
|
|
|
5
5
|
side by side when the main minimum, preferred aside width, and gap fit; they
|
|
6
6
|
otherwise stack. No `.container-query` ancestor is required.
|
|
7
7
|
|
|
8
|
+
**Related terms:** master-detail, split view.
|
|
9
|
+
|
|
8
10
|
```html demo
|
|
9
11
|
<div class="sidebar-layout">
|
|
10
12
|
<article class="stack">
|
|
@@ -44,12 +44,16 @@ not as the wrapper that lays out independent full-width regions of a page.
|
|
|
44
44
|
`--gap` is the primitive's channel, and the density variants set it at the point
|
|
45
45
|
of use. Pick the one that matches how tightly the children belong together:
|
|
46
46
|
|
|
47
|
-
| Markup
|
|
48
|
-
|
|
49
|
-
| `.stack gap-none` | 0
|
|
50
|
-
| `.stack sm`
|
|
51
|
-
| `.stack`
|
|
52
|
-
| `.stack lg`
|
|
47
|
+
| Markup | Gap | Use for |
|
|
48
|
+
| ----------------- | ---- | ------------------------------------------ |
|
|
49
|
+
| `.stack gap-none` | 0 | Lines forming one typographic unit |
|
|
50
|
+
| `.stack sm` | 8px | A homogeneous series of controls |
|
|
51
|
+
| `.stack` | 12px | Normal flow between distinct elements |
|
|
52
|
+
| `.stack lg` | 24px | Sections, or blocks that read as separated |
|
|
53
|
+
|
|
54
|
+
One typographic unit means a name and a job title, or a figure and its caption.
|
|
55
|
+
A homogeneous series means a radio list, a checkbox list, or a compact vertical
|
|
56
|
+
menu.
|
|
53
57
|
|
|
54
58
|
The distinction between the first two matters. `42` above `Open issues` is
|
|
55
59
|
almost a single block of text, so it takes `gap-none`. Three `.choice` labels
|
|
@@ -21,3 +21,5 @@ Use `.topbar` for the structural shell of an app-shell header: sticky positionin
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
This is for the app-shell topbar specifically — a structural need that recurs unchanged across app UIs regardless of brand. It is not for marketing or editorial site headers, which are one-off visual identity per page.
|
|
24
|
+
|
|
25
|
+
**Related terms:** sticky header, app bar, application header.
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Choose list markup from the content semantics, then add only the layout or
|
|
4
4
|
component contract the collection needs.
|
|
5
5
|
|
|
6
|
-
| Need
|
|
7
|
-
|
|
|
8
|
-
| Bullets or order carry meaning
|
|
9
|
-
|
|
|
10
|
-
| Repeated
|
|
11
|
-
| A list of navigation links
|
|
12
|
-
| A richer collection with its own item structure | Native list plus
|
|
6
|
+
| Need | Use |
|
|
7
|
+
| ----------------------------------------------- | ----------------------------------- |
|
|
8
|
+
| Bullets or order carry meaning | Native `<ul>` or `<ol>` |
|
|
9
|
+
| Leading element plus flexible content | [`.media`](../layout/media.md) |
|
|
10
|
+
| Repeated rows: leading, content, trailing | [`.list`](../components/list.md) |
|
|
11
|
+
| A list of navigation links | [`.nav-list`](./navigation-list.md) |
|
|
12
|
+
| A richer collection with its own item structure | Native list plus primitives |
|
|
13
13
|
|
|
14
14
|
`.media` and `.list` are not interchangeable. `.media` is geometry for one
|
|
15
15
|
two-part composition and requires exactly two direct children. `.list` owns the
|
|
@@ -5,7 +5,7 @@ Text hidden visually but still available to assistive technology.
|
|
|
5
5
|
## Class reference
|
|
6
6
|
|
|
7
7
|
| Class | Kind | Description |
|
|
8
|
-
|
|
8
|
+
| ---------- | ------- | --------------------------------------------------------------- |
|
|
9
9
|
| `.sr-only` | Utility | Visually hides text while keeping it in the accessibility tree. |
|
|
10
10
|
|
|
11
11
|
## Screen reader only
|
|
@@ -32,3 +32,21 @@ Use `.sr-only` for text that should be available to assistive technology but vis
|
|
|
32
32
|
border: 0;
|
|
33
33
|
}
|
|
34
34
|
```
|
|
35
|
+
|
|
36
|
+
## Touch targets
|
|
37
|
+
|
|
38
|
+
`.touch-target` adds 8px of invisible hit area around a small control on coarse
|
|
39
|
+
primary pointers, without growing the visual. Apply it opt-in to targets that
|
|
40
|
+
are genuinely small — icon buttons, close buttons, compact actions.
|
|
41
|
+
|
|
42
|
+
```html demo
|
|
43
|
+
<button class="btn icon-only touch-target" type="button" aria-label="Close">
|
|
44
|
+
<i class="ti ti-x" aria-hidden="true"></i>
|
|
45
|
+
</button>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Related terms:** touch target, hit area, tap target, target size.
|
|
49
|
+
|
|
50
|
+
On fine pointers the class is fully neutral. On coarse pointers it establishes
|
|
51
|
+
a relative positioning context — do not apply it to controls whose positioning
|
|
52
|
+
is structural (`fixed`, `absolute`, `sticky`).
|
|
@@ -4,19 +4,26 @@ Small flex helpers for grow behavior and other one-line needs.
|
|
|
4
4
|
|
|
5
5
|
## Class reference
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
| `.
|
|
12
|
-
| `.items-
|
|
13
|
-
| `.
|
|
14
|
-
| `.
|
|
15
|
-
| `.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
|
7
|
+
Base utilities:
|
|
8
|
+
|
|
9
|
+
| Class | Description |
|
|
10
|
+
| --------------- | -------------------------------------------------------------- |
|
|
11
|
+
| `.grow` | Makes an item take available flex space without overflowing. |
|
|
12
|
+
| `.items-start` | Aligns children to the block-start edge; sets `--items-align`. |
|
|
13
|
+
| `.items-center` | Centers children on the cross axis; sets `--items-align`. |
|
|
14
|
+
| `.items-end` | Aligns children to the block-end edge; sets `--items-align`. |
|
|
15
|
+
| `.dot` | Inline separator dot for metadata rows. |
|
|
16
|
+
|
|
17
|
+
Extra utilities:
|
|
18
|
+
|
|
19
|
+
| Class | Description |
|
|
20
|
+
| -------------------------------- | --------------------------------------------------------- |
|
|
21
|
+
| `.justify-content-start` | `justify-content: flex-start` and `--cluster-justify`. |
|
|
22
|
+
| `.justify-content-center` | `justify-content: center` and `--cluster-justify`. |
|
|
23
|
+
| `.justify-content-end` | `justify-content: flex-end` and `--cluster-justify`. |
|
|
24
|
+
| `.justify-content-space-between` | `justify-content: space-between` and `--cluster-justify`. |
|
|
25
|
+
| `.flex-wrap` | `flex-wrap: wrap` on any flex container. |
|
|
26
|
+
| `.flex-nowrap` | `flex-wrap: nowrap` on any flex container. |
|
|
20
27
|
|
|
21
28
|
## Grow
|
|
22
29
|
|
|
@@ -5,7 +5,7 @@ Link styling for chrome that is conceptually a link but should not look like pro
|
|
|
5
5
|
## Class reference
|
|
6
6
|
|
|
7
7
|
| Class | Kind | Description |
|
|
8
|
-
|
|
8
|
+
| ------------- | ------- | --------------------------------------------------------- |
|
|
9
9
|
| `.link-plain` | Utility | Removes the underline and inherits the surrounding color. |
|
|
10
10
|
| `.link-muted` | Utility | Muted link that shifts to the full text color on hover. |
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ Utilities for list chrome reset, readable measure, and editorial kicker labels.
|
|
|
5
5
|
## Class reference
|
|
6
6
|
|
|
7
7
|
| Class | Kind | Description |
|
|
8
|
-
|
|
8
|
+
| ------------- | --------- | ------------------------------------------------------------- |
|
|
9
9
|
| `.list-reset` | Utility | Removes native list margin, padding, and markers. |
|
|
10
10
|
| `.measure` | Utility | Caps a block at a readable width via `--measure`. |
|
|
11
11
|
| `.overline` | Component | Small editorial kicker label: muted, uppercase, letterspaced. |
|
|
@@ -4,13 +4,20 @@ Explicit overflow handling for content that may exceed its container.
|
|
|
4
4
|
|
|
5
5
|
## Class reference
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
| `.overflow-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
Base utilities:
|
|
8
|
+
|
|
9
|
+
| Class | Description |
|
|
10
|
+
| ---------------- | ----------------------------------------------------- |
|
|
11
|
+
| `.overflow-auto` | Enables scrolling when content exceeds the container. |
|
|
12
|
+
|
|
13
|
+
Extra utilities:
|
|
14
|
+
|
|
15
|
+
| Class | Description |
|
|
16
|
+
| ------------------ | ----------------------------------------------------- |
|
|
17
|
+
| `.overflow-hidden` | Clips overflowing content. |
|
|
18
|
+
| `.overflow-clip` | Clips overflowing content without a scroll container. |
|
|
19
|
+
| `.overflow-x-auto` | Horizontal scrolling only. |
|
|
20
|
+
| `.overflow-y-auto` | Vertical scrolling only. |
|
|
14
21
|
|
|
15
22
|
Use `.overflow-auto` when content may overflow its container, especially tables and code-like regions.
|
|
16
23
|
|
|
@@ -7,6 +7,28 @@ Utilities are a small escape hatch for common single-purpose needs. They should
|
|
|
7
7
|
- Keep utility names stable, boring, and few.
|
|
8
8
|
- Utilities should use logical properties where relevant.
|
|
9
9
|
|
|
10
|
+
## Two layers
|
|
11
|
+
|
|
12
|
+
Utilities ship in two modules, and the split is about **naming and curation**,
|
|
13
|
+
not about opting in. Importing `actual-css/css/utilities` — or
|
|
14
|
+
`actual.full.css` — gives you both.
|
|
15
|
+
|
|
16
|
+
| Module | Import | Naming |
|
|
17
|
+
| --------- | -------------------------------- | ---------------------------------- |
|
|
18
|
+
| **Base** | `actual-css/css/utilities/base` | Compact names, frequent operations |
|
|
19
|
+
| **Extra** | `actual-css/css/utilities/extra` | Explicit property/value names |
|
|
20
|
+
|
|
21
|
+
Base is the curated set, and it is where a short name is allowed: `.px`, `.py`,
|
|
22
|
+
`.mbs`, `.gap-none`. Extra spells out the property and the value — `.gap-sm`,
|
|
23
|
+
`.overflow-x-auto`, `.justify-content-center` — and never gives a base utility
|
|
24
|
+
a second spelling.
|
|
25
|
+
|
|
26
|
+
Reach for base first. Extra exists so an explicit one-off does not have to
|
|
27
|
+
become a new short name, which is the pressure that grows a utility surface.
|
|
28
|
+
|
|
29
|
+
Extra utilities are concentrated in flex, overflow and spacing; those pages
|
|
30
|
+
list the two layers as separate tables. Every other utility page is base only.
|
|
31
|
+
|
|
10
32
|
## Non-Goals
|
|
11
33
|
|
|
12
34
|
> Utilities deliberately excluded to keep the surface small and intentional.
|
|
@@ -5,7 +5,7 @@ Rare shape utilities for cases that must be perfectly round or square.
|
|
|
5
5
|
## Class reference
|
|
6
6
|
|
|
7
7
|
| Class | Kind | Description |
|
|
8
|
-
|
|
8
|
+
| --------- | ------- | --------------------------------------------------- |
|
|
9
9
|
| `.circle` | Utility | Forces a perfectly round shape via `--radius-full`. |
|
|
10
10
|
|
|
11
11
|
Shape utilities should be rare because shape is mostly theme-level.
|
|
@@ -4,13 +4,13 @@ Small layout corrections for controls, labels, and compact rails.
|
|
|
4
4
|
|
|
5
5
|
## Class reference
|
|
6
6
|
|
|
7
|
-
| Class | Kind | Description
|
|
8
|
-
|
|
9
|
-
| `.fit` | Utility | Shrinks
|
|
10
|
-
| `.text-nowrap` | Utility | Keeps text on one line.
|
|
11
|
-
| `.truncate` | Utility | Ellipsizes overflowing single-line text.
|
|
12
|
-
| `.scroller` |
|
|
13
|
-
| `.scroller.stable-gutter` | Variant | Reserves scrollbar gutter
|
|
7
|
+
| Class | Kind | Description |
|
|
8
|
+
| ------------------------- | ------- | ----------------------------------------- |
|
|
9
|
+
| `.fit` | Utility | Shrinks an element to its content width. |
|
|
10
|
+
| `.text-nowrap` | Utility | Keeps text on one line. |
|
|
11
|
+
| `.truncate` | Utility | Ellipsizes overflowing single-line text. |
|
|
12
|
+
| `.scroller` | Layout | Theme-aware scrollbar density and colour. |
|
|
13
|
+
| `.scroller.stable-gutter` | Variant | Reserves inline-axis scrollbar gutter. |
|
|
14
14
|
|
|
15
15
|
Use `.fit` when a control or element should shrink to its content instead of filling the available inline space.
|
|
16
16
|
|
|
@@ -78,7 +78,9 @@ above the capability floor. An engine that knows neither ignores both
|
|
|
78
78
|
declarations and draws its native scrollbar — the intended fallback, not a
|
|
79
79
|
broken state.
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
`.scroller` is a layout primitive, so it comes with `actual.full.css` and with
|
|
82
|
+
`actual-css/css/layout` like `.stack` or `.cluster`. A project importing module
|
|
83
|
+
by module reaches it directly:
|
|
82
84
|
|
|
83
85
|
```css
|
|
84
86
|
@import "actual-css/css/layout/scroller";
|