actual-css 0.17.1 → 0.19.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 +87 -0
- package/README.md +10 -6
- package/components.json +26 -6
- package/dist/actual.full.css +484 -76
- package/dist/actual.full.js +2 -2
- package/dist/actual.full.min.css +1 -1
- package/docs/design-notes/enhancement-contract.md +20 -11
- package/docs/design-notes/motion-cost.md +62 -0
- package/docs/design-notes/tokens.md +6 -1
- package/docs/navigation.json +4 -0
- package/docs/pages/components/alert.md +8 -6
- package/docs/pages/components/aura.md +3 -0
- package/docs/pages/components/button.md +26 -24
- package/docs/pages/components/list.md +117 -29
- package/docs/pages/components/mark-sweep.md +42 -0
- package/docs/pages/components/rating.md +53 -22
- package/docs/pages/components/reveal.md +54 -0
- package/docs/pages/components/shimmer.md +3 -2
- package/docs/pages/components/timeline.md +130 -2
- package/docs/pages/enhancements/in-view.md +109 -0
- package/docs/pages/enhancements/overview.md +3 -2
- package/docs/pages/enhancements/scrollspy.md +5 -5
- package/docs/pages/examples/overview.md +7 -2
- package/docs/pages/forms/date-picker.md +3 -2
- package/docs/pages/forms/switch.md +25 -16
- package/docs/pages/foundations/theming.md +6 -4
- package/docs/pages/foundations/tokens.md +39 -16
- package/docs/pages/foundations/typography.md +13 -2
- package/docs/pages/guides/coding-agents.md +163 -0
- package/docs/pages/guides/introduction.md +1 -1
- package/docs/pages/guides/modular-import.md +1 -1
- package/docs/pages/guides/progressive-enhancement.md +2 -1
- package/docs/pages/guides/upgrading.md +2 -2
- package/docs/pages/layout/scroll-snap.md +26 -1
- package/docs/pages/patterns/code-block.md +1 -1
- package/docs/pages/patterns/empty-state.md +3 -3
- package/docs/pages/patterns/exclusive-accordion.md +3 -2
- package/docs/pages/patterns/hierarchical-nav.md +5 -4
- package/docs/pages/patterns/icon-input.md +1 -1
- package/docs/pages/patterns/icon-slot.md +4 -4
- package/docs/pages/patterns/intent-nesting.md +2 -3
- package/docs/pages/patterns/navigation-list.md +7 -4
- package/docs/pages/patterns/stat.md +3 -3
- package/docs/pages/patterns/structured-lists.md +1 -2
- package/llms.txt +3 -2
- package/package.json +3 -1
- package/reserved-classes.json +6 -0
- package/skills/actual-css/PROJECT.md.example +13 -2
- package/skills/actual-css/README.md +5 -0
- package/skills/actual-css/SKILL.md +13 -2
- package/src/css/components/alert.css +40 -3
- package/src/css/components/button.css +20 -2
- package/src/css/components/join.css +3 -10
- package/src/css/components/list.css +32 -0
- package/src/css/components/navbar.css +13 -5
- package/src/css/components/rating.css +23 -2
- package/src/css/components/scrollspy.css +4 -2
- package/src/css/components/timeline.css +113 -10
- package/src/css/core/base.css +16 -0
- package/src/css/core/focus.css +13 -12
- package/src/css/core/reset.css +10 -0
- package/src/css/core/theme.css +15 -0
- package/src/css/core/tokens.css +8 -11
- package/src/css/effects/aura.css +5 -0
- package/src/css/effects/index.css +2 -0
- package/src/css/effects/mark-sweep.css +64 -0
- package/src/css/effects/reveal.css +66 -0
- package/src/css/effects/shimmer.css +28 -10
- package/src/css/forms/switch.css +9 -9
- package/src/js/full.js +1 -0
- package/src/js/in-view.js +152 -0
- package/src/js/scrollspy.js +81 -2
- package/src/js/selectors.js +3 -0
- package/src/tooling/design-components.js +2 -2
- package/src/tooling/design-tokens.js +2 -0
- package/tokens.json +2 -0
|
@@ -171,14 +171,23 @@ of the contract itself.
|
|
|
171
171
|
|
|
172
172
|
## Token vocabulary
|
|
173
173
|
|
|
174
|
-
| Token | Behavior | Existing class
|
|
175
|
-
| ------------ | ------------------------------------------------ |
|
|
176
|
-
| `tabs` | Tab panel switching, arrow-key navigation | `.tabs`
|
|
177
|
-
| `flyout` | Trigger → panel positioning, open/close | `.flyout`
|
|
178
|
-
| `range` | Fill share and named-value synchronization | `.range`
|
|
179
|
-
| `scrollspy` | Scroll-driven nav highlighting | `.scrollspy`
|
|
180
|
-
| `
|
|
181
|
-
| `
|
|
182
|
-
| `
|
|
183
|
-
|
|
184
|
-
|
|
174
|
+
| Token | Behavior | Existing class |
|
|
175
|
+
| ------------ | ------------------------------------------------ | ------------------------ |
|
|
176
|
+
| `tabs` | Tab panel switching, arrow-key navigation | `.tabs` |
|
|
177
|
+
| `flyout` | Trigger → panel positioning, open/close | `.flyout` |
|
|
178
|
+
| `range` | Fill share and named-value synchronization | `.range` |
|
|
179
|
+
| `scrollspy` | Scroll-driven nav highlighting | `.scrollspy` |
|
|
180
|
+
| `in-view` | One-shot viewport appearance state | `.reveal`, `.mark-sweep` |
|
|
181
|
+
| `validation` | Form validation, focus management, server errors | `.needs-validation` |
|
|
182
|
+
| `dirty` | Unsaved-changes state on a form | — |
|
|
183
|
+
| `ajax` | Form submission through `fetch` | — |
|
|
184
|
+
|
|
185
|
+
Eight tokens. Everything else stays self-describing.
|
|
186
|
+
|
|
187
|
+
`in-view` is a presentation trigger, not an animation system: it writes
|
|
188
|
+
`is-pending` while an element waits outside the viewport and removes it on the
|
|
189
|
+
first intersection. The effect's CSS owns what that state looks like, and the
|
|
190
|
+
element is never hidden before the observer's first callback reports it off
|
|
191
|
+
screen. Its one concession to motion is focus: a release by `focusin` finishes
|
|
192
|
+
the animations that removing the state started, found by difference, because
|
|
193
|
+
a CSS `:focus-within` override lapses on blur and replays the entrance.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Motion cost
|
|
2
|
+
|
|
3
|
+
What an animation costs per frame depends on the property it animates, not on
|
|
4
|
+
how complex the effect looks. `transform` and `opacity` run on the compositor:
|
|
5
|
+
the layer is rastered once and moved. Anything else — a registered custom
|
|
6
|
+
property, `box-shadow`, `background-position` — runs style and paint on the
|
|
7
|
+
main thread every frame, off screen included.
|
|
8
|
+
|
|
9
|
+
## Measuring
|
|
10
|
+
|
|
11
|
+
`bun run report:paint` loads each page it is given and reports renderer CPU,
|
|
12
|
+
main-thread task time and frame pacing over a fixed window. Give it one page
|
|
13
|
+
per variant; a fixture reads its variant from the query string. Confirm a
|
|
14
|
+
finding in a real browser with DevTools → Rendering → Paint flashing: a
|
|
15
|
+
repainted element flashes green on every frame.
|
|
16
|
+
|
|
17
|
+
## Aura
|
|
18
|
+
|
|
19
|
+
`.aura` animates `--aura-angle`, a registered property that feeds the frame's
|
|
20
|
+
`conic-gradient`. The usual border-beam technique, built with a JavaScript
|
|
21
|
+
component that adds a beam element, draws the same light by rotating a static
|
|
22
|
+
conic square with `transform`, cut to a ring by a mask.
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
bun run report:paint \
|
|
26
|
+
"scripts/fixtures/aura-paint.html?variant=frozen&n=20" \
|
|
27
|
+
"scripts/fixtures/aura-paint.html?variant=current&n=20" \
|
|
28
|
+
"scripts/fixtures/aura-paint.html?variant=glow&n=20" \
|
|
29
|
+
"scripts/fixtures/aura-paint.html?variant=layout&n=20" \
|
|
30
|
+
"scripts/fixtures/aura-paint.html?variant=static&n=20" \
|
|
31
|
+
"scripts/fixtures/aura-paint.html?variant=nohalo&n=20" \
|
|
32
|
+
"scripts/fixtures/aura-paint.html?variant=rotate&n=20"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Measured on 2026-11-12, headless Chrome, renderer CPU in ms per second:
|
|
36
|
+
|
|
37
|
+
| Auras on screen | Frozen | `.aura` | `.aura-glow` | Rotated beam |
|
|
38
|
+
| ------------------ | ------ | --------- | ------------ | ------------ |
|
|
39
|
+
| 1 | 14 | 150–210 | 118 | 35–45 |
|
|
40
|
+
| 4 | 17 | 290–590 | 537 | 35–90 |
|
|
41
|
+
| 20 | 20–40 | 1150–1700 | 815 | 90–100 |
|
|
42
|
+
| 5 (+15 off screen) | 20 | ~500 | 360 | ~90 |
|
|
43
|
+
|
|
44
|
+
Paint flashing in Chrome agreed: every `.aura` flashes, the beam never does.
|
|
45
|
+
No variant dropped below 60 fps.
|
|
46
|
+
|
|
47
|
+
- The cost is the `--aura-angle` animation itself. `contain: layout`, a static
|
|
48
|
+
near halo on its own layer, and no near halo at all all stayed within noise
|
|
49
|
+
of the current aura.
|
|
50
|
+
- Off-screen auras keep paying main-thread style on every frame.
|
|
51
|
+
- `.aura-glow` costs less but still repaints: its far halo breathes through
|
|
52
|
+
`box-shadow`.
|
|
53
|
+
|
|
54
|
+
Aura keeps its implementation. The compositor version needs an element to
|
|
55
|
+
rotate inside a ring-shaped clip, and `.aura` has none to give: both pseudos
|
|
56
|
+
are taken (near halo, occlusion), a mask on `.aura` would clip the child, and
|
|
57
|
+
`overflow: clip` would cut the halo and the child's focus ring. Adding a beam
|
|
58
|
+
element would break the one-child contract for an effect meant for one or two
|
|
59
|
+
objects per view, which is what the Aura page now asks.
|
|
60
|
+
|
|
61
|
+
Reopen this if a design needs many simultaneous auras: the answer is then an
|
|
62
|
+
explicit beam element, not containment.
|
|
@@ -75,6 +75,10 @@ Mixing against `black`, `white`, `transparent`, or `currentColor` is exempt and
|
|
|
75
75
|
|
|
76
76
|
Ordinary interaction/state transitions have **no easing token**: they use the CSS default `ease` directly, and the dialog shake feedback plus the `actual-dialog` View Transition keep that default deliberately. The presence pair exists only for one-shot open/close where open and closed states own separate easing values (`.status-bar`/`.is-open`, `dialog.modal[open]`, `dialog.drawer[open]`): `--ease-enter` decelerates the appearance, `--ease-exit` accelerates the departure. The pair follows Material's standard rhythm; the emphasized-decelerate entrance is deliberately not offered because it only pays off at 250–400ms durations, beyond this vocabulary. Backdrops keep `ease` — a scrim only fades, it does not travel — but track their surface's duration. Toggles that share one transition list at `--duration-fast` (flyout, tooltip) also stay on `ease`: at 100ms the curve barely resolves and entry/exit cannot split on a single rule. These absences are deliberate, not gaps; a theme with a different motion character overrides `--ease-enter` / `--ease-exit`.
|
|
77
77
|
|
|
78
|
+
Reveal and Mark sweep use native `ease-out`: the surface entrance curve
|
|
79
|
+
completes too much of a fade or highlight sweep near the start. Their gentler
|
|
80
|
+
deceleration is local to those effects, rather than another shared easing token.
|
|
81
|
+
|
|
78
82
|
## Internal tokens
|
|
79
83
|
|
|
80
84
|
Internal tokens are allowed when they reduce duplication or make component code clearer.
|
|
@@ -85,7 +89,8 @@ The shared visual variants are:
|
|
|
85
89
|
|
|
86
90
|
- `.solid`: full background, paired foreground. This is the default for buttons.
|
|
87
91
|
- `.soft`: lightly tinted background, colored text. Good for alerts, badges, and secondary actions.
|
|
88
|
-
- `.outline`: transparent background, colored
|
|
92
|
+
- `.outline`: transparent background, colored text, and a text-colored border;
|
|
93
|
+
a neutral `.btn.outline` takes the `--border-control` edge instead.
|
|
89
94
|
- `.surface`: the page surface with the theme border, and the intent only in the text. The neutral chrome neither `.soft` (the intent-tinted treatment) nor `.outline` (no fill) can give.
|
|
90
95
|
|
|
91
96
|
Buttons also support two button-only variants:
|
package/docs/navigation.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"bootstrap",
|
|
20
20
|
"tailwind",
|
|
21
21
|
"design-tools",
|
|
22
|
+
"coding-agents",
|
|
22
23
|
"upgrading"
|
|
23
24
|
]
|
|
24
25
|
},
|
|
@@ -75,11 +76,13 @@
|
|
|
75
76
|
"indicator",
|
|
76
77
|
"key",
|
|
77
78
|
"list",
|
|
79
|
+
"mark-sweep",
|
|
78
80
|
"meter",
|
|
79
81
|
"navbar",
|
|
80
82
|
"pagination",
|
|
81
83
|
"progress",
|
|
82
84
|
"rating",
|
|
85
|
+
"reveal",
|
|
83
86
|
"segmented",
|
|
84
87
|
"shimmer",
|
|
85
88
|
"skeleton",
|
|
@@ -160,6 +163,7 @@
|
|
|
160
163
|
"tooltip",
|
|
161
164
|
"tabs",
|
|
162
165
|
"scrollspy",
|
|
166
|
+
"in-view",
|
|
163
167
|
"status-bar"
|
|
164
168
|
]
|
|
165
169
|
},
|
|
@@ -246,13 +246,13 @@ full-bleed notice.
|
|
|
246
246
|
|
|
247
247
|
## Admonition
|
|
248
248
|
|
|
249
|
-
An admonition is a structured box with a tinted title bar, an optional icon, and body content on the page surface — like the `!!! note` callouts in mkdocs. Use `.alert-title` for the header and `.alert-body` for the content. Intent classes tint the title bar background and the border; shared variants paint the title bar, so `.solid` fills it — and keeps the body's frame neutral — for a notification that needs to stand out.
|
|
249
|
+
An admonition is a structured box with a tinted title bar, an optional icon, and body content on the page surface — like the `!!! note` callouts in mkdocs. Use `.alert-title` for the header and `.alert-body` for the content. An icon in the title takes `.alert-icon`, so `--alert-icon-nudge` reaches it too. Intent classes tint the title bar background and the border; shared variants paint the title bar, so `.solid` fills it — and keeps the body's frame neutral — for a notification that needs to stand out.
|
|
250
250
|
|
|
251
251
|
```html demo
|
|
252
252
|
<div class="stack">
|
|
253
253
|
<div class="alert admonition">
|
|
254
254
|
<div class="alert-title">
|
|
255
|
-
<i class="ti ti-info-circle" aria-hidden="true"></i>
|
|
255
|
+
<i class="ti ti-info-circle alert-icon" aria-hidden="true"></i>
|
|
256
256
|
Note
|
|
257
257
|
</div>
|
|
258
258
|
<div class="alert-body">
|
|
@@ -262,7 +262,7 @@ An admonition is a structured box with a tinted title bar, an optional icon, and
|
|
|
262
262
|
|
|
263
263
|
<div class="alert warning admonition">
|
|
264
264
|
<div class="alert-title">
|
|
265
|
-
<i class="ti ti-alert-triangle" aria-hidden="true"></i>
|
|
265
|
+
<i class="ti ti-alert-triangle alert-icon" aria-hidden="true"></i>
|
|
266
266
|
Warning
|
|
267
267
|
</div>
|
|
268
268
|
<div class="alert-body">
|
|
@@ -272,7 +272,7 @@ An admonition is a structured box with a tinted title bar, an optional icon, and
|
|
|
272
272
|
|
|
273
273
|
<div class="alert success admonition solid">
|
|
274
274
|
<div class="alert-title">
|
|
275
|
-
<i class="ti ti-circle-check" aria-hidden="true"></i>
|
|
275
|
+
<i class="ti ti-circle-check alert-icon" aria-hidden="true"></i>
|
|
276
276
|
Saved
|
|
277
277
|
</div>
|
|
278
278
|
<div class="alert-body">
|
|
@@ -286,8 +286,10 @@ An admonition is a structured box with a tinted title bar, an optional icon, and
|
|
|
286
286
|
|
|
287
287
|
- `--alert-pad-inline` — inline padding. Stays stable across density contexts.
|
|
288
288
|
- `--alert-pad-block` — block padding.
|
|
289
|
-
- `--alert-font-size` — base font size.
|
|
290
|
-
- `--alert-
|
|
289
|
+
- `--alert-font-size` — base font size. Keep it in `rem` or `px`: the icon offset is a `calc()` evaluated on the icon, where an `em` would resolve against the icon's size.
|
|
290
|
+
- `--alert-line-height` — the alert's line box. The icon offset is derived from it, so change the rhythm here rather than with `line-height`.
|
|
291
|
+
- `--alert-icon-size` — size of a leading `.alert-icon`. Set it from the text (`calc(var(--alert-font-size) * 1.25)`) when the icon should scale with the type.
|
|
292
|
+
- `--alert-icon-nudge` — local correction to the icon's centring on the first line box, for an off-centre glyph or a theme tile larger than `--alert-icon-size`. An `em` here follows the icon size; the correction does not move the close button.
|
|
291
293
|
- `--close-size` / `--close-icon-size` — the alert declares compact values for its `.close`; set them on the alert to change them.
|
|
292
294
|
- `--alert-radius` — corner radius, when the default `--radius-lg` does not fit.
|
|
293
295
|
- `--alert-border-inline-start-color` / `--alert-border-inline-start-width` — extension points for a callout-style colored flag on the leading edge instead of a uniform border.
|
|
@@ -109,6 +109,9 @@ the accent, or one breath of the glow.
|
|
|
109
109
|
</div>
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
Both animations repaint the aura on every frame, even off screen. Reserve aura
|
|
113
|
+
for the one or two objects a view emphasizes, not for every card in a grid.
|
|
114
|
+
|
|
112
115
|
Keep exactly one direct child and set `--aura-radius` when its shape differs
|
|
113
116
|
from the common button, card, alert, and badge shapes detected as a visual
|
|
114
117
|
enhancement.
|
|
@@ -4,23 +4,23 @@ Actions and navigation with shared intents, variants, sizes, and loading, presse
|
|
|
4
4
|
|
|
5
5
|
## Class reference
|
|
6
6
|
|
|
7
|
-
| Class | Kind | Description
|
|
8
|
-
| ------------- | --------- |
|
|
9
|
-
| `.btn` | Component | Base button, solid by default.
|
|
10
|
-
| `.primary` | Intent | Primary action.
|
|
11
|
-
| `.secondary` | Intent | Secondary action.
|
|
12
|
-
| `.success` | Intent | Positive outcome.
|
|
13
|
-
| `.warning` | Intent | Caution.
|
|
14
|
-
| `.danger` | Intent | Destructive action.
|
|
15
|
-
| `.neutral` | Intent | Neutral tone (the `.btn` default).
|
|
16
|
-
| `.soft` | Variant | Muted intent-tinted surface.
|
|
17
|
-
| `.outline` | Variant | Transparent with an intent
|
|
18
|
-
| `.solid` | Variant | Filled intent background — the `.btn` default.
|
|
19
|
-
| `.surface` | Variant | Page surface, neutral border, intent on the label.
|
|
20
|
-
| `.ghost` | Variant | Borderless text button (button-only).
|
|
21
|
-
| `.link` | Variant | Underlined text button (button-only).
|
|
22
|
-
| `.sm` / `.lg` | Size | Compact or large control height.
|
|
23
|
-
| `.icon-only` | Variant | Square icon button sized to the control height.
|
|
7
|
+
| Class | Kind | Description |
|
|
8
|
+
| ------------- | --------- | ------------------------------------------------------- |
|
|
9
|
+
| `.btn` | Component | Base button, solid by default. |
|
|
10
|
+
| `.primary` | Intent | Primary action. |
|
|
11
|
+
| `.secondary` | Intent | Secondary action. |
|
|
12
|
+
| `.success` | Intent | Positive outcome. |
|
|
13
|
+
| `.warning` | Intent | Caution. |
|
|
14
|
+
| `.danger` | Intent | Destructive action. |
|
|
15
|
+
| `.neutral` | Intent | Neutral tone (the `.btn` default). |
|
|
16
|
+
| `.soft` | Variant | Muted intent-tinted surface. |
|
|
17
|
+
| `.outline` | Variant | Transparent with a control edge; an intent recolors it. |
|
|
18
|
+
| `.solid` | Variant | Filled intent background — the `.btn` default. |
|
|
19
|
+
| `.surface` | Variant | Page surface, neutral border, intent on the label. |
|
|
20
|
+
| `.ghost` | Variant | Borderless text button (button-only). |
|
|
21
|
+
| `.link` | Variant | Underlined text button (button-only). |
|
|
22
|
+
| `.sm` / `.lg` | Size | Compact or large control height. |
|
|
23
|
+
| `.icon-only` | Variant | Square icon button sized to the control height. |
|
|
24
24
|
|
|
25
25
|
## Basic usage
|
|
26
26
|
|
|
@@ -75,13 +75,15 @@ component with shared variants reads, so the same declaration works on a badge:
|
|
|
75
75
|
The rule ties with the variant's own `--ui-bg` on specificity, so load it after
|
|
76
76
|
Actual CSS or import `actual.layer.css`.
|
|
77
77
|
|
|
78
|
-
Transparent treatments (`.outline`, `.ghost`, `.link`)
|
|
79
|
-
foreground by default, including on a band your application paints.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
Transparent treatments (`.outline`, `.ghost`, `.link`) take their text from the
|
|
79
|
+
surrounding foreground by default, including on a band your application paints.
|
|
80
|
+
A neutral outline draws its border with `--border-control`, the theme's control
|
|
81
|
+
edge, so it matches an adjacent field rather than the band ink; set
|
|
82
|
+
`--ui-border` when the border must follow the band. A local intent class still
|
|
83
|
+
wins: `.danger.outline` uses the danger color in any context, and nothing tunes
|
|
84
|
+
that color for a surface you paint yourself. For intent ink on a dark band, use
|
|
85
|
+
a `data-theme` island, whose palette is tuned for its surface. Filled buttons
|
|
86
|
+
own their surface and keep their normal intent recipe.
|
|
85
87
|
|
|
86
88
|
A dark button (inverse, contrast) is a custom intent on the button itself, so
|
|
87
89
|
every variant keeps working — `.outline` and `.ghost` take the solid ink:
|
|
@@ -7,27 +7,55 @@ and trailing metadata or controls. Use `.media` for a single two-part
|
|
|
7
7
|
media/content relationship, `.nav-list` for navigation structure, and native
|
|
8
8
|
list markers when order or bullets carry meaning.
|
|
9
9
|
|
|
10
|
+
A bare `.list` is intentionally surface-less: it draws the leading and
|
|
11
|
+
inter-row dividers and lets a card, drawer, or page section own the background.
|
|
12
|
+
Add `.grouped` when the rows stand on their own.
|
|
13
|
+
|
|
14
|
+
## Grouped
|
|
15
|
+
|
|
16
|
+
`.list.grouped` paints the raised surface, border, and rounded shell, adds the
|
|
17
|
+
inline gutter a standalone list needs, and rounds the first and last rows so a
|
|
18
|
+
hover or current fill stays inside the shell. Keep the bare `.list` when an
|
|
19
|
+
existing surface already frames the rows.
|
|
20
|
+
|
|
10
21
|
```html demo
|
|
11
|
-
<ul class="list">
|
|
22
|
+
<ul class="list grouped" style="max-inline-size: 34rem">
|
|
23
|
+
<li class="list-item">
|
|
24
|
+
<i class="ti ti-device-laptop muted" aria-hidden="true"></i>
|
|
25
|
+
<span class="list-item-content">
|
|
26
|
+
<strong class="list-item-title">Work laptop · Firefox</strong>
|
|
27
|
+
<span class="list-item-text">Brussels, BE · 12 minutes ago</span>
|
|
28
|
+
</span>
|
|
29
|
+
<span class="badge success">Current session</span>
|
|
30
|
+
</li>
|
|
12
31
|
<li class="list-item">
|
|
13
|
-
<
|
|
32
|
+
<i class="ti ti-device-mobile muted" aria-hidden="true"></i>
|
|
14
33
|
<span class="list-item-content">
|
|
15
|
-
<strong class="list-item-title">
|
|
16
|
-
<span class="list-item-text">
|
|
34
|
+
<strong class="list-item-title">Phone · Safari</strong>
|
|
35
|
+
<span class="list-item-text">Ghent, BE · 3 hours ago</span>
|
|
17
36
|
</span>
|
|
18
|
-
<
|
|
37
|
+
<button class="btn surface sm"
|
|
38
|
+
type="button"
|
|
39
|
+
style="--btn-radius: var(--radius-full)">End session</button>
|
|
19
40
|
</li>
|
|
20
41
|
<li class="list-item">
|
|
21
|
-
<
|
|
42
|
+
<i class="ti ti-device-tablet muted" aria-hidden="true"></i>
|
|
22
43
|
<span class="list-item-content">
|
|
23
|
-
<strong class="list-item-title">
|
|
24
|
-
<span class="list-item-text">
|
|
44
|
+
<strong class="list-item-title">Tablet · Safari</strong>
|
|
45
|
+
<span class="list-item-text">Antwerp, BE · yesterday</span>
|
|
25
46
|
</span>
|
|
26
|
-
<
|
|
47
|
+
<button class="btn surface sm"
|
|
48
|
+
type="button"
|
|
49
|
+
style="--btn-radius: var(--radius-full)">End session</button>
|
|
27
50
|
</li>
|
|
28
51
|
</ul>
|
|
29
52
|
```
|
|
30
53
|
|
|
54
|
+
The end-session actions are `.btn surface sm` with
|
|
55
|
+
`--btn-radius: var(--radius-full)`: a neutral pill with the theme's muted border
|
|
56
|
+
and the normal text color, rather than `.outline`'s transparent fill and control
|
|
57
|
+
edge.
|
|
58
|
+
|
|
31
59
|
Leading and trailing content are unconstrained: avatars, native choices,
|
|
32
60
|
badges, text, switches, and buttons retain their own component sizing. In a
|
|
33
61
|
narrow row, the trailing region moves under the content rather than breaking a
|
|
@@ -42,13 +70,8 @@ gap: `.list-item-content` always takes the row's free space and
|
|
|
42
70
|
leading region or not. A settings row — a label, a description, and one
|
|
43
71
|
control on the end edge — is the two-region form.
|
|
44
72
|
|
|
45
|
-
Regions center on the row. When supporting text runs to three lines or more,
|
|
46
|
-
add `.items-start` to the row, or to the `.list` for every row, so the leading
|
|
47
|
-
avatar and the trailing control stay on the title line instead of floating
|
|
48
|
-
mid-paragraph (top-align, align to first line).
|
|
49
|
-
|
|
50
73
|
```html demo
|
|
51
|
-
<ul class="list">
|
|
74
|
+
<ul class="list grouped" style="max-inline-size: 34rem">
|
|
52
75
|
<li class="list-item">
|
|
53
76
|
<label class="list-item-content" for="row-memory">
|
|
54
77
|
<span class="list-item-title">Memory</span>
|
|
@@ -71,16 +94,79 @@ mid-paragraph (top-align, align to first line).
|
|
|
71
94
|
</ul>
|
|
72
95
|
```
|
|
73
96
|
|
|
97
|
+
Regions center on the row. When supporting text runs to three lines or more,
|
|
98
|
+
add `.items-start` to the row, or to the `.list` for every row, so the leading
|
|
99
|
+
avatar and the trailing control stay on the title line instead of floating
|
|
100
|
+
mid-paragraph (top-align, align to first line).
|
|
101
|
+
|
|
102
|
+
## Row actions
|
|
103
|
+
|
|
104
|
+
Do not attach click JavaScript to the entire row. Use a link for navigation and
|
|
105
|
+
a button or native control for actions. Put row actions in the trailing region:
|
|
106
|
+
a single control, or a `.flyout-trigger` around a `⋯` button when the row has
|
|
107
|
+
several. The trigger stays a normal button and the menu keeps the
|
|
108
|
+
`.menu > li > .menu-item` anatomy; [Flyout](../enhancements/flyout.md) owns the
|
|
109
|
+
wiring.
|
|
110
|
+
|
|
111
|
+
```html demo
|
|
112
|
+
<ul class="list grouped" style="max-inline-size: 34rem">
|
|
113
|
+
<li class="list-item">
|
|
114
|
+
<span class="avatar sm"><abbr>NL</abbr></span>
|
|
115
|
+
<span class="list-item-content">
|
|
116
|
+
<strong class="list-item-title">Nadia Laurent</strong>
|
|
117
|
+
<span class="list-item-text">nadia@example.com</span>
|
|
118
|
+
</span>
|
|
119
|
+
<div class="list-item-trailing cluster">
|
|
120
|
+
<span class="badge soft primary">Owner</span>
|
|
121
|
+
<div class="flyout-trigger">
|
|
122
|
+
<button class="btn ghost sm"
|
|
123
|
+
type="button"
|
|
124
|
+
data-enhance="flyout"
|
|
125
|
+
aria-expanded="false"
|
|
126
|
+
aria-controls="member-actions"
|
|
127
|
+
aria-label="Actions for Nadia Laurent">
|
|
128
|
+
<i class="ti ti-dots" aria-hidden="true"></i>
|
|
129
|
+
</button>
|
|
130
|
+
<menu class="flyout sm menu" id="member-actions" hidden>
|
|
131
|
+
<li><button class="menu-item" type="button">Manage access</button></li>
|
|
132
|
+
<li><button class="menu-item" type="button">Copy invite link</button></li>
|
|
133
|
+
<hr class="menu-separator">
|
|
134
|
+
<li><button class="menu-item danger" type="button">Remove member</button></li>
|
|
135
|
+
</menu>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</li>
|
|
139
|
+
<li class="list-item">
|
|
140
|
+
<span class="avatar sm"><abbr>TR</abbr></span>
|
|
141
|
+
<span class="list-item-content">
|
|
142
|
+
<strong class="list-item-title">Tomás Rivera</strong>
|
|
143
|
+
<span class="list-item-text">tomas@example.com</span>
|
|
144
|
+
</span>
|
|
145
|
+
<span class="badge">Editor</span>
|
|
146
|
+
</li>
|
|
147
|
+
<li class="list-item">
|
|
148
|
+
<span class="avatar sm"><abbr>IO</abbr></span>
|
|
149
|
+
<span class="list-item-content">
|
|
150
|
+
<strong class="list-item-title">Ines Okafor</strong>
|
|
151
|
+
<span class="list-item-text">ines@example.com</span>
|
|
152
|
+
</span>
|
|
153
|
+
<span class="badge">Viewer</span>
|
|
154
|
+
</li>
|
|
155
|
+
</ul>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Navigation
|
|
159
|
+
|
|
74
160
|
For a navigable row, keep the list semantics and put `.list-item` on the link:
|
|
75
161
|
|
|
76
162
|
```html demo
|
|
77
|
-
<ul class="list">
|
|
163
|
+
<ul class="list grouped" style="max-inline-size: 34rem">
|
|
78
164
|
<li>
|
|
79
|
-
<a class="list-item" href="#
|
|
80
|
-
<span class="avatar sm" aria-hidden="true"><i class="ti ti-
|
|
165
|
+
<a class="list-item" href="#notifications">
|
|
166
|
+
<span class="avatar sm" aria-hidden="true"><i class="ti ti-bell" aria-hidden="true"></i></span>
|
|
81
167
|
<span class="list-item-content">
|
|
82
|
-
<strong class="list-item-title">
|
|
83
|
-
<span class="list-item-text">
|
|
168
|
+
<strong class="list-item-title">Notifications</strong>
|
|
169
|
+
<span class="list-item-text">Email, push, and digest settings</span>
|
|
84
170
|
</span>
|
|
85
171
|
<i class="ti ti-chevron-right list-item-trailing" aria-hidden="true"></i>
|
|
86
172
|
</a>
|
|
@@ -88,21 +174,23 @@ For a navigable row, keep the list semantics and put `.list-item` on the link:
|
|
|
88
174
|
</ul>
|
|
89
175
|
```
|
|
90
176
|
|
|
91
|
-
Do not attach click JavaScript to the entire row. Use a link for navigation and
|
|
92
|
-
a button or native control for actions.
|
|
93
|
-
|
|
94
177
|
Mark the current row on its link with `aria-current="page"` when the row opens
|
|
95
178
|
a page, or `aria-current="true"` when it is the current item of a master/detail
|
|
96
179
|
view (a conversation, a thread, a record) that is not a page of its own. Any
|
|
97
|
-
other value is inert. The [Workspaces example](../examples/overview.md)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
180
|
+
other value is inert. The [Workspaces example](../examples/overview.md) shows a
|
|
181
|
+
current row with trailing actions and a flyout. Navigable rows usually want a
|
|
182
|
+
non-zero `--list-item-pad-inline`: without that gutter, the current indicator
|
|
183
|
+
touches the leading region and the trailing touches the row edge. `.grouped`
|
|
184
|
+
sets that gutter already.
|
|
101
185
|
|
|
102
186
|
## Hooks
|
|
103
187
|
|
|
104
188
|
- `--list-item-min-size` controls the row's minimum touch height.
|
|
105
189
|
- `--list-item-pad-block` and `--list-item-pad-inline` control row padding.
|
|
190
|
+
`.grouped` raises the inline padding to a standalone surface's gutter; set
|
|
191
|
+
the hook on the list to choose another.
|
|
106
192
|
- `--list-item-gap` controls spacing between the regions a row actually has.
|
|
107
|
-
- `--list-divider` controls the
|
|
108
|
-
|
|
193
|
+
- `--list-divider` controls the inter-row dividers, and the leading divider on
|
|
194
|
+
a bare list. `.grouped` replaces that leading divider with its shell border.
|
|
195
|
+
The final row deliberately has no trailing divider.
|
|
196
|
+
- `--list-radius` controls the corner radius of the `.grouped` shell.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Mark sweep
|
|
2
|
+
|
|
3
|
+
Mark Sweep wipes a highlight in behind a phrase the first time it enters the viewport, using the same colors as `<mark>`.
|
|
4
|
+
|
|
5
|
+
> **Module** — import `actual-css/css/effects/mark-sweep` and `actual-css/js/in-view`, or the `actual-css/css/effects` and `actual-css/js/full` bundles.
|
|
6
|
+
|
|
7
|
+
```html demo
|
|
8
|
+
<p>Ship the <mark class="mark-sweep" data-enhance="in-view">small parts</mark> that carry the interface.</p>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Related terms:** highlighter, marker, text highlight, annotation, highlight on scroll.
|
|
12
|
+
|
|
13
|
+
`<mark>` means the phrase is relevant in its context. Keep it for that meaning; use `.mark-sweep` when the highlight is decoration and the text is an ordinary span.
|
|
14
|
+
|
|
15
|
+
At rest the phrase carries the full highlight, so no JavaScript, reduced motion, and print all show the same readable text. `data-enhance="in-view"` adds `is-pending` while the phrase waits off screen; the sweep then grows the background from the reading direction's start edge. The transition is declared on the base state, so it is defined when the class is removed.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Try the [Appearance effects catalogue](../../demo/templates/appearance.html#mark)
|
|
20
|
+
to replay highlights in theme colors and both reading directions.
|
|
21
|
+
|
|
22
|
+
- Load the runtime with `actual-css/js/full`, or register only `actual-css/js/in-view`.
|
|
23
|
+
- Put the token and class on the phrase itself, not on the surrounding paragraph: the observer measures the highlighted box.
|
|
24
|
+
- The sweep is one-shot. Use it for a few phrases per page; a paragraph where every other word sweeps reads as an effect demo, not as writing.
|
|
25
|
+
- The base `<mark>` pair comes from the theme. An intent class on the same element gives the sweep a soft tint with theme text: `.primary`, `.secondary`, `.success`, `.warning`, `.danger`, or `.neutral`. The tint uses `--soft-bg-mix`; without `color-mix()`, the theme highlight pair remains.
|
|
26
|
+
- Forced colors replaces the sweep with the system `Mark` / `MarkText` pair, so the phrase stays distinct on both `<mark>` and `<span>`.
|
|
27
|
+
|
|
28
|
+
See [In view](../enhancements/in-view.md) for trigger margins, pending state,
|
|
29
|
+
and immediate appearance on keyboard focus.
|
|
30
|
+
|
|
31
|
+
```html demo
|
|
32
|
+
<p>
|
|
33
|
+
A <mark class="mark-sweep warning" data-enhance="in-view">deadline</mark> is a fact;
|
|
34
|
+
an <mark class="mark-sweep primary" data-enhance="in-view">idea worth keeping</mark>
|
|
35
|
+
is a decision.
|
|
36
|
+
</p>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Hooks
|
|
40
|
+
|
|
41
|
+
- `--mark-sweep-duration` — time for the highlight to cross the phrase.
|
|
42
|
+
- `--mark-bg`, `--mark-fg` — the highlight pair, shared with base `<mark>`; set them on a theme or on an element for a local color. Keep the text legible against both the highlight and the uncovered surface during the sweep.
|