actual-css 0.18.0 → 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 +48 -0
- package/README.md +7 -5
- package/components.json +6 -2
- package/dist/actual.full.css +272 -57
- 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 +4 -0
- package/docs/navigation.json +3 -0
- package/docs/pages/components/aura.md +3 -0
- 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/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 +5 -2
- package/docs/pages/forms/date-picker.md +3 -2
- package/docs/pages/forms/switch.md +25 -16
- package/docs/pages/foundations/tokens.md +37 -15
- package/docs/pages/foundations/typography.md +8 -2
- 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 +1 -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 +2 -1
- package/package.json +3 -1
- package/reserved-classes.json +4 -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/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 +4 -10
- 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/choice.css +0 -7
- 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-tokens.js +2 -0
- package/tokens.json +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.19.0] - 2026-11-13
|
|
6
|
+
### Added
|
|
7
|
+
- `.reveal` and `.reveal-group`: one-shot entrance animations that play on first render, with `--reveal-duration`, `--reveal-distance`, and `--reveal-stagger`.
|
|
8
|
+
- `data-enhance="in-view"`: defers an off-screen effect to its first appearance, with `data-in-view-margin`.
|
|
9
|
+
- `.mark-sweep`: a highlight that sweeps in behind a phrase, reusing the new `--mark-bg` / `--mark-fg` theme pair.
|
|
10
|
+
- `mark`: a theme-tuned highlight pair in both schemes, with `Mark` / `MarkText` in forced colors.
|
|
11
|
+
- Docs: an In view enhancement page, and a Replay button on every example that holds `.reveal`, `.reveal-group` or `.mark-sweep`.
|
|
12
|
+
- `demo/templates/appearance.html`: scroll reveals, staggered groups, highlight sweeps and site-defined effects, with replay controls.
|
|
13
|
+
- `bun run report:paint`: renderer CPU, main-thread time and frame pacing per page, to compare animation variants.
|
|
14
|
+
- `docs/design-notes/motion-cost.md`: what an animation costs per frame, with the Aura measurements and `scripts/fixtures/aura-paint.html`.
|
|
15
|
+
- `demo/templates/blocks.html`: notification preferences composition with Email and Push switch columns.
|
|
16
|
+
- `demo/templates/focus-bench.html`: component focus samples, validation alternatives, surface and theme islands, and computed-style inspection of a live data grid.
|
|
17
|
+
- `demo/templates/border-contrast.html`: `--border-control` at 25, 35 and 45 % of ink in both schemes and on two surfaces, with the edge measured live against the control fill and the panel, and the mix that silently does nothing on a plain container.
|
|
18
|
+
- `--rating-star-outline`: the default star as an outline, for `--rating-star-empty`.
|
|
19
|
+
- `cyberpunk` theme: ink rating stars with outlined empty stars.
|
|
20
|
+
- `neon` theme: rating stars as lit and unlit primary tubes.
|
|
21
|
+
- `material` theme: Google Yellow rating stars over `--border`.
|
|
22
|
+
- `neo-brutalist` theme: a framed square `.status-bar` instead of the core pill.
|
|
23
|
+
- `demo/templates/neo-brutalist.html`: the cookie notice enters with `.reveal` and confirms the choice in the status bar.
|
|
24
|
+
- `demo/sites/neon-ramen`: read-only ratings on the home stats and the Spicy miso page, a "Rate your last bowl" input on the order page, and neon-tube stars in `neon-site.css`.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
- `.rating`: stars are gold by default instead of `--warning`; set `--rating-color` on `.rating` to restore it.
|
|
28
|
+
- `.rating`: empty stars tint `--text` into `--surface` instead of using `--border`, so ink-bordered themes no longer draw them black.
|
|
29
|
+
- Docs: the Rating page shows neutral, outlined and custom-symbol stars, and the theme rule that sets them.
|
|
30
|
+
- Docs: Rating form examples use `.field-group.flush`, adding `.field` only with help or error text.
|
|
31
|
+
- Docs: `--border-control` states the `--surface-subtle` ratio, why `--border-control-mix` needs a theme boundary, and the two ways to soften controls — the theme mix or `--control-border` on the fields.
|
|
32
|
+
- Switch docs and demo templates use native checkbox state without redundant `aria-checked` synchronization.
|
|
33
|
+
- `.switch`: the border follows the track fill, including checked and disabled states, and unchecked hover uses a subtle neutral fill.
|
|
34
|
+
- `:focus` uses local `--focus` for generic outlines; `--focus-outline-color` remains an inherited override, and invalid fields keep their validation color.
|
|
35
|
+
- `.nav-list`: a nested `.nav-list` hangs from a rail under the parent's icon, its labels still aligned with the parent label.
|
|
36
|
+
- `.nav-list`: `--nav-list-icon-size` (the leading icon width) replaces `--nav-list-indent`.
|
|
37
|
+
- `.nav-list`: `--nav-list-rail-color` sets the nested rail; `transparent` hides it and keeps the alignment.
|
|
38
|
+
- `.shimmer`: the band has a fixed width, crosses the whole label, then rests before the next pass.
|
|
39
|
+
- Docs home: the hero title enters with `.reveal` on first render.
|
|
40
|
+
- Docs: Aura repaints every frame; reserve it for one or two objects per view.
|
|
41
|
+
- `--duration-shimmer` slows from 1.2s to 2s, pacing `.shimmer`, `.skeleton` and indeterminate `.progress`.
|
|
42
|
+
- `.switch`: `--switch-knob-margin` increases from 8% to 10% of the track height, giving the knob more breathing room.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
- `.scrollspy`: native selection yields to `aria-current`, and the activation line advances near the scroll end so trailing sections activate in order.
|
|
46
|
+
- `.scrollspy`: a followed link stays current even when the page cannot scroll its heading to the activation line, and scrolling on walks its neighbours in order.
|
|
47
|
+
- A closed `<dialog>` stays hidden when an author class sets `display`, such as `<dialog class="card">`.
|
|
48
|
+
- Docs home test: the menu-to-dialog focus check waits for the close event instead of reading focus before it runs.
|
|
49
|
+
- `fixtureUrl()` keeps a page's query string and hash instead of escaping them into the file name.
|
|
50
|
+
- `.shimmer`: the sweep runs right to left in right-to-left text.
|
|
51
|
+
- `demo/templates/blocks.html`: table filters share one wrapping cluster so the status and owner selects sit side by side when space permits.
|
|
52
|
+
|
|
5
53
|
## [0.18.0] - 2026-11-11
|
|
6
54
|
### Added
|
|
7
55
|
- Docs: "Coding agents and DESIGN.md" guide — the skill, `PRODUCT.md`/`DESIGN.md`/`PROJECT.md` ownership, and working with a design skill such as Impeccable.
|
package/README.md
CHANGED
|
@@ -67,7 +67,7 @@ size is not worth optimizing:
|
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
```html
|
|
70
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/actual-css@0.
|
|
70
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/actual-css@0.19/dist/actual.full.min.css">
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
## Usage
|
|
@@ -107,6 +107,8 @@ Undocumented `is-*` classes are runtime internals.
|
|
|
107
107
|
|
|
108
108
|
**UI components** — dialog, drawer, flyout, tooltip, tabs, scrollspy, context menus, and other components that rely on JavaScript or modern platform behavior.
|
|
109
109
|
|
|
110
|
+
**Effects** — aura, shimmer, mark sweep, and reveal: purely visual enrichment, with motion that respects reduced-motion.
|
|
111
|
+
|
|
110
112
|
**Patterns** — navbar and overline. These are regular source files and can be imported only when needed.
|
|
111
113
|
|
|
112
114
|
**Layout primitives** — `.stack`, `.cluster`, `.grid`, `.switcher`, `.center`, `.media`, `.frame`, `.app-shell`, `.sidebar-layout`, and `.container-query`.
|
|
@@ -134,7 +136,7 @@ for the full map of module names to import paths.
|
|
|
134
136
|
|
|
135
137
|
## JavaScript enhancers
|
|
136
138
|
|
|
137
|
-
Some components can be enhanced with JavaScript: dialog/drawer, flyout, tooltip, tabs, scrollspy, context menu, floating UI, opt-in `data-filter` input filtering, and
|
|
139
|
+
Some components can be enhanced with JavaScript: dialog/drawer, flyout, tooltip, tabs, scrollspy, context menu, floating UI, opt-in `data-filter` input filtering, input masks, and the one-shot `in-view` trigger behind `.reveal` and `.mark-sweep`.
|
|
138
140
|
|
|
139
141
|
Presentation (`class`) and behaviour (`data-enhance`) are separate layers — import any primitive independently to build custom widgets. See [enhancement contract](docs/design-notes/enhancement-contract.md) and [widget primitives](docs/design-notes/widget-primitives.md).
|
|
140
142
|
|
|
@@ -144,7 +146,7 @@ registries:
|
|
|
144
146
|
* **Full runtime, zero-config** — every built-in enhancer, compiled:
|
|
145
147
|
|
|
146
148
|
```html
|
|
147
|
-
<script src="https://cdn.jsdelivr.net/npm/actual-css@0.
|
|
149
|
+
<script src="https://cdn.jsdelivr.net/npm/actual-css@0.19/dist/actual.full.js" type="module"></script>
|
|
148
150
|
```
|
|
149
151
|
|
|
150
152
|
* **Your own build** — copy the package's `src/js/full.js` as your entry,
|
|
@@ -186,8 +188,8 @@ Actual CSS is before 1.0:
|
|
|
186
188
|
* A patch release (`0.12.0` → `0.12.1`) keeps every class and hook. It fixes
|
|
187
189
|
bugs and may add hooks, so a fix can still move a rendering by a few pixels.
|
|
188
190
|
|
|
189
|
-
The floating `actual-css@0.
|
|
190
|
-
version (`actual-css@0.
|
|
191
|
+
The floating `actual-css@0.19` CDN path takes patches automatically. Pin the exact
|
|
192
|
+
version (`actual-css@0.19.0`) when the rendering must not change without a
|
|
191
193
|
review.
|
|
192
194
|
|
|
193
195
|
## Browser support
|
package/components.json
CHANGED
|
@@ -580,10 +580,12 @@
|
|
|
580
580
|
"publicHooks": [
|
|
581
581
|
"--nav-current-bg",
|
|
582
582
|
"--nav-current-fg",
|
|
583
|
-
"--nav-list-
|
|
583
|
+
"--nav-list-icon-size",
|
|
584
|
+
"--nav-list-rail-color"
|
|
584
585
|
],
|
|
585
586
|
"internalHooks": [
|
|
586
|
-
"--gap"
|
|
587
|
+
"--gap",
|
|
588
|
+
"--nav-list-rail-inset"
|
|
587
589
|
],
|
|
588
590
|
"states": [
|
|
589
591
|
"aria-current",
|
|
@@ -640,6 +642,7 @@
|
|
|
640
642
|
"--rating-empty",
|
|
641
643
|
"--rating-star",
|
|
642
644
|
"--rating-star-empty",
|
|
645
|
+
"--rating-star-outline",
|
|
643
646
|
"--rating-value",
|
|
644
647
|
"--rating-max"
|
|
645
648
|
],
|
|
@@ -662,6 +665,7 @@
|
|
|
662
665
|
"scrollspy"
|
|
663
666
|
],
|
|
664
667
|
"states": [
|
|
668
|
+
"aria-current",
|
|
665
669
|
"target"
|
|
666
670
|
],
|
|
667
671
|
"jsImport": "actual-css/js/scrollspy",
|
package/dist/actual.full.css
CHANGED
|
@@ -34,6 +34,16 @@ select {
|
|
|
34
34
|
display: none !important;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/* The UA hides a closed dialog from its own origin, so any author display
|
|
38
|
+
wins over it, even at zero specificity: `<dialog class="card">` stayed on
|
|
39
|
+
screen after its method="dialog" form closed it. Not !important, unlike
|
|
40
|
+
[hidden]: an important declaration outranks transitions, and the modal's
|
|
41
|
+
exit fade transitions display. A dialog that needs another closed display
|
|
42
|
+
says so with a more specific selector. */
|
|
43
|
+
dialog:not([open]) {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
37
47
|
:where(img, svg, video) {
|
|
38
48
|
max-inline-size: 100%;
|
|
39
49
|
block-size: auto;
|
|
@@ -140,19 +150,13 @@ select {
|
|
|
140
150
|
--duration-fast: 100ms;
|
|
141
151
|
--duration-slow: 200ms;
|
|
142
152
|
--duration-spin: 0.75s;
|
|
143
|
-
--duration-shimmer:
|
|
153
|
+
--duration-shimmer: 2s;
|
|
144
154
|
--ease-enter: cubic-bezier(0.2, 0, 0, 1);
|
|
145
155
|
--ease-exit: cubic-bezier(0.4, 0, 1, 1);
|
|
146
156
|
|
|
147
|
-
/*
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
for the two contracts. Both share --focus-ring-width: they differ in
|
|
151
|
-
color only. No --focus-outline alias here: declared on :root it would be
|
|
152
|
-
inherited already computed, so a theme island or a region setting
|
|
153
|
-
--focus-ring-width would not reach it. focus.css composes the line on the
|
|
154
|
-
focused element instead. */
|
|
155
|
-
--focus-outline-color: currentColor;
|
|
157
|
+
/* Focus geometry is shared by the generic line and component rings.
|
|
158
|
+
focus.css composes the line on its target; the optional color and whole-
|
|
159
|
+
outline hooks stay unset so local theme tokens reach their fallbacks. */
|
|
156
160
|
--focus-outline-offset: 2px;
|
|
157
161
|
--focus-ring-width: 2px;
|
|
158
162
|
|
|
@@ -419,6 +423,11 @@ select {
|
|
|
419
423
|
--text-muted: hsl(259 9% 42%);
|
|
420
424
|
--text-subtle: hsl(258 7% 57%);
|
|
421
425
|
|
|
426
|
+
/* Highlight pair for <mark> and .mark-sweep: a warm, non-warning yellow that
|
|
427
|
+
keeps the phrase legible in both schemes. */
|
|
428
|
+
--mark-bg: hsl(48 95% 68%);
|
|
429
|
+
--mark-fg: hsl(38 45% 12%);
|
|
430
|
+
|
|
422
431
|
/* Lines and focus */
|
|
423
432
|
--border: hsl(260 15% 88%);
|
|
424
433
|
/* A primary-hued mid-tone on purpose, one value for both schemes: focus
|
|
@@ -475,6 +484,16 @@ select {
|
|
|
475
484
|
--control-default-bg: var(--surface);
|
|
476
485
|
}
|
|
477
486
|
|
|
487
|
+
/* Custom properties accept unknown functions, so guard the pair to preserve
|
|
488
|
+
the light fallback. Redeclare on islands to follow their own color-scheme. */
|
|
489
|
+
@supports (color: light-dark(red, blue)) {
|
|
490
|
+
:root,
|
|
491
|
+
[data-theme] {
|
|
492
|
+
--mark-bg: light-dark(hsl(48 95% 68%), hsl(44 55% 30%));
|
|
493
|
+
--mark-fg: light-dark(hsl(38 45% 12%), hsl(44 60% 94%));
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
478
497
|
@supports (color: color-mix(in oklab, red, white)) {
|
|
479
498
|
:root,
|
|
480
499
|
[data-theme] {
|
|
@@ -695,6 +714,22 @@ small {
|
|
|
695
714
|
font-size: 0.875em;
|
|
696
715
|
}
|
|
697
716
|
|
|
717
|
+
/* A semantic highlight. The UA's yellow ignores the theme and clashes with a
|
|
718
|
+
dark palette, so the pair comes from the theme instead. `.mark-sweep` reuses
|
|
719
|
+
the same pair for its animated background. Forced colors keep the system
|
|
720
|
+
Mark pair, the one place the glyph/background relationship is guaranteed. */
|
|
721
|
+
mark {
|
|
722
|
+
background: var(--mark-bg);
|
|
723
|
+
color: var(--mark-fg);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
@media (forced-colors: active) {
|
|
727
|
+
mark {
|
|
728
|
+
background: Mark;
|
|
729
|
+
color: MarkText;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
698
733
|
::selection {
|
|
699
734
|
background: var(--selection-bg, var(--primary));
|
|
700
735
|
color: var(--selection-fg, var(--primary-fg));
|
|
@@ -950,17 +985,11 @@ small {
|
|
|
950
985
|
for its keyboard focus indicator; forced colors keep outlines and drop
|
|
951
986
|
shadows.
|
|
952
987
|
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
draw the themed ring instead — a solid line in --focus: inset on fields
|
|
959
|
-
(inside their border box), offset by --focus-outline-offset on discrete
|
|
960
|
-
actions. The color never derives from an intent or a local
|
|
961
|
-
surface — the theme guarantees --focus at 3:1 against both --surface and
|
|
962
|
-
--surface-solid, so one token reads on the page, on a solid band and on
|
|
963
|
-
any nested surface.
|
|
988
|
+
All default indicators use --focus, independently of intent, selection or
|
|
989
|
+
text color. Components adapt the geometry: inset on fields (inside their
|
|
990
|
+
border box), offset by --focus-outline-offset on discrete actions. Themes
|
|
991
|
+
target 3:1 against --surface and --surface-solid; other painted backgrounds
|
|
992
|
+
still need their own contrast check.
|
|
964
993
|
|
|
965
994
|
A .segment is an action but takes the inset ring: its track's padding is
|
|
966
995
|
narrower than an offset ring, which would cover the neighbouring segment.
|
|
@@ -972,9 +1001,16 @@ small {
|
|
|
972
1001
|
|
|
973
1002
|
Public hooks:
|
|
974
1003
|
--focus-outline (fallback-only: replaces the whole generic line)
|
|
1004
|
+
--focus-outline-color (fallback-only: overrides the generic line color)
|
|
975
1005
|
*/
|
|
976
1006
|
:focus {
|
|
977
|
-
|
|
1007
|
+
/* Resolve the default on the target: a root alias would freeze --focus
|
|
1008
|
+
before a theme island or a plain region could override it. Keeping the
|
|
1009
|
+
color hook unset also lets an inherited author override cross islands. */
|
|
1010
|
+
outline: var(
|
|
1011
|
+
--focus-outline,
|
|
1012
|
+
var(--focus-ring-width) solid var(--focus-outline-color, var(--focus))
|
|
1013
|
+
);
|
|
978
1014
|
outline-offset: var(--focus-outline-offset);
|
|
979
1015
|
}
|
|
980
1016
|
|
|
@@ -2698,13 +2734,6 @@ small {
|
|
|
2698
2734
|
--choice-border: var(--text-subtle);
|
|
2699
2735
|
}
|
|
2700
2736
|
|
|
2701
|
-
/* A bare checkbox or radio (a table row selector, an application's native
|
|
2702
|
-
control) is boxed by its own skin, not text-like: it takes the themed ring
|
|
2703
|
-
instead of the core currentColor fallback, which paints the text ink. */
|
|
2704
|
-
:where(input[type="checkbox"], input[type="radio"]) {
|
|
2705
|
-
--focus-outline-color: var(--focus);
|
|
2706
|
-
}
|
|
2707
|
-
|
|
2708
2737
|
.check:focus-visible,
|
|
2709
2738
|
.radio:focus-visible {
|
|
2710
2739
|
outline: var(--focus-ring-width) solid var(--focus);
|
|
@@ -3174,11 +3203,12 @@ small {
|
|
|
3174
3203
|
|
|
3175
3204
|
.switch {
|
|
3176
3205
|
--switch-bg: var(--border);
|
|
3177
|
-
|
|
3206
|
+
/* Keep the border in the geometry without outlining the track. */
|
|
3207
|
+
--switch-border: var(--switch-bg);
|
|
3178
3208
|
--switch-knob: var(--surface-raised);
|
|
3179
3209
|
--switch-block-size: calc(var(--choice-control-size) + 0.125em);
|
|
3180
3210
|
--switch-width: calc(var(--switch-block-size) * 1.8);
|
|
3181
|
-
--switch-knob-margin: calc(var(--switch-block-size) * 0.
|
|
3211
|
+
--switch-knob-margin: calc(var(--switch-block-size) * 0.1);
|
|
3182
3212
|
|
|
3183
3213
|
/* The knob is concentric in the track: --switch-block-size is a border-box
|
|
3184
3214
|
height, so the borders have to come out before the inset is applied on
|
|
@@ -3241,16 +3271,16 @@ small {
|
|
|
3241
3271
|
background-color var(--duration);
|
|
3242
3272
|
}
|
|
3243
3273
|
|
|
3244
|
-
/*
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
.switch:not(:checked):hover:not(:disabled) {
|
|
3248
|
-
|
|
3274
|
+
/* Guard the custom property so older browsers keep the resting fill rather
|
|
3275
|
+
than substituting an unsupported mix into both background and border. */
|
|
3276
|
+
@supports (color: color-mix(in oklab, black, white)) {
|
|
3277
|
+
.switch:not(:checked):hover:not(:disabled) {
|
|
3278
|
+
--switch-bg: color-mix(in oklab, var(--text) 10%, var(--border));
|
|
3279
|
+
}
|
|
3249
3280
|
}
|
|
3250
3281
|
|
|
3251
3282
|
.switch:checked {
|
|
3252
3283
|
--switch-bg: var(--intent, var(--state-selected));
|
|
3253
|
-
--switch-border: var(--intent, var(--state-selected));
|
|
3254
3284
|
--switch-knob: var(--intent-fg, var(--state-selected-fg));
|
|
3255
3285
|
}
|
|
3256
3286
|
|
|
@@ -3281,7 +3311,6 @@ small {
|
|
|
3281
3311
|
|
|
3282
3312
|
.switch:disabled {
|
|
3283
3313
|
--switch-bg: var(--surface-subtle);
|
|
3284
|
-
--switch-border: var(--border);
|
|
3285
3314
|
--switch-knob: var(--state-disabled);
|
|
3286
3315
|
opacity: 1;
|
|
3287
3316
|
cursor: not-allowed;
|
|
@@ -7953,6 +7982,7 @@ a.avatar[aria-disabled="true"] {
|
|
|
7953
7982
|
* --rating-empty
|
|
7954
7983
|
* --rating-star
|
|
7955
7984
|
* --rating-star-empty (the empty star's shape; the filled one by default)
|
|
7985
|
+
* --rating-star-outline (a ready outline of the default star, for the hook above)
|
|
7956
7986
|
* --rating-value (display: the shown value, fractions allowed)
|
|
7957
7987
|
* --rating-max (display: the number of stars)
|
|
7958
7988
|
*
|
|
@@ -7968,10 +7998,18 @@ a.avatar[aria-disabled="true"] {
|
|
|
7968
7998
|
.rating {
|
|
7969
7999
|
--rating-size: 1.25rem;
|
|
7970
8000
|
--rating-gap: var(--space-10);
|
|
7971
|
-
|
|
8001
|
+
/* why: gold stars are the convention a reader recognizes, so the default
|
|
8002
|
+
owns its color instead of borrowing --warning's meaning. A literal, not
|
|
8003
|
+
light-dark(): it reads on both schemes, and an unsupported light-dark()
|
|
8004
|
+
here would invalidate the fill. Accepted trade-off: 2.1:1 on a white
|
|
8005
|
+
surface, under the 3:1 graphics target; the value lives in the
|
|
8006
|
+
aria-label, and a theme picks its own ink on .rating. */
|
|
8007
|
+
--rating-color: var(--intent, hsl(38 92% 50%));
|
|
7972
8008
|
--rating-empty: var(--border);
|
|
7973
8009
|
--rating-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 2 16 16'%3E%3Cpath d='M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 0 0 .95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 0 0-.364 1.118l1.07 3.292c.3.922-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 0 0-1.175 0l-2.8 2.034c-.783.57-1.838-.196-1.539-1.118l1.07-3.292a1 1 0 0 0-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 0 0 .951-.69l1.07-3.292Z'/%3E%3C/svg%3E");
|
|
7974
|
-
/*
|
|
8010
|
+
/* The default star stroked inside its own clip, so the line never grows
|
|
8011
|
+
the silhouette and a filled and an empty star stay the same size. */
|
|
8012
|
+
--rating-star-outline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 2 16 16'%3E%3CclipPath id='c'%3E%3Cpath d='M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 0 0 .95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 0 0-.364 1.118l1.07 3.292c.3.922-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 0 0-1.175 0l-2.8 2.034c-.783.57-1.838-.196-1.539-1.118l1.07-3.292a1 1 0 0 0-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 0 0 .951-.69l1.07-3.292Z'/%3E%3C/clipPath%3E%3Cpath d='M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 0 0 .95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 0 0-.364 1.118l1.07 3.292c.3.922-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 0 0-1.175 0l-2.8 2.034c-.783.57-1.838-.196-1.539-1.118l1.07-3.292a1 1 0 0 0-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 0 0 .951-.69l1.07-3.292Z' fill='none' stroke='black' stroke-width='2.4' clip-path='url(%23c)'/%3E%3C/svg%3E");
|
|
7975
8013
|
--rating-star-empty: var(--rating-star);
|
|
7976
8014
|
|
|
7977
8015
|
display: inline-flex;
|
|
@@ -7979,6 +8017,18 @@ a.avatar[aria-disabled="true"] {
|
|
|
7979
8017
|
color: var(--rating-color);
|
|
7980
8018
|
}
|
|
7981
8019
|
|
|
8020
|
+
/* why: an empty star is a fill, not a stroke. --border is a stroke token, and
|
|
8021
|
+
a theme with ink-dark borders (brutalist, cyberpunk) turned every empty star
|
|
8022
|
+
solid black, louder than the filled ones. A light ink tint over the surface
|
|
8023
|
+
reads as the same pale star on every theme. Guarded: inside a custom
|
|
8024
|
+
property an unsupported color-mix() would invalidate the fill, not fall back
|
|
8025
|
+
to --border. */
|
|
8026
|
+
@supports (color: color-mix(in oklab, red, white)) {
|
|
8027
|
+
.rating {
|
|
8028
|
+
--rating-empty: color-mix(in oklab, var(--text) 15%, var(--surface));
|
|
8029
|
+
}
|
|
8030
|
+
}
|
|
8031
|
+
|
|
7982
8032
|
.rating > input[type="radio"] {
|
|
7983
8033
|
appearance: none;
|
|
7984
8034
|
flex: 0 0 auto;
|
|
@@ -8937,10 +8987,12 @@ a.avatar[aria-disabled="true"] {
|
|
|
8937
8987
|
* Public hooks:
|
|
8938
8988
|
* --nav-current-bg (fallback-only: current-link fill)
|
|
8939
8989
|
* --nav-current-fg (fallback-only: current-link ink)
|
|
8940
|
-
* --nav-list-
|
|
8990
|
+
* --nav-list-icon-size (fallback-only: leading icon width the nested rail centres on)
|
|
8991
|
+
* --nav-list-rail-color (fallback-only: transparent hides the rail, alignment kept)
|
|
8941
8992
|
*
|
|
8942
8993
|
* Internal:
|
|
8943
8994
|
* --gap (local value for the shared gap token)
|
|
8995
|
+
* --nav-list-rail-inset (half the icon on each side of the nested rail)
|
|
8944
8996
|
*/
|
|
8945
8997
|
/* Intent boundary — inherited intents do not tint this component.
|
|
8946
8998
|
Local intent classes still win because :where() has zero specificity.
|
|
@@ -9105,12 +9157,18 @@ a.avatar[aria-disabled="true"] {
|
|
|
9105
9157
|
transform: rotate(180deg);
|
|
9106
9158
|
}
|
|
9107
9159
|
|
|
9108
|
-
/* A nested list
|
|
9109
|
-
|
|
9110
|
-
|
|
9160
|
+
/* A nested list hangs from a rail under the centre of the parent's leading
|
|
9161
|
+
icon, and its labels start under the parent's label. The two halves of the
|
|
9162
|
+
icon split around the rail, which balances because .nav-link's gap and
|
|
9163
|
+
inline padding are the same step. --nav-list-icon-size is the icon's width,
|
|
9164
|
+
fallback-only: a base declaration on .nav-list would reset an override at
|
|
9165
|
+
every level. */
|
|
9111
9166
|
.nav-list .nav-list {
|
|
9112
9167
|
margin-block-start: var(--gap);
|
|
9113
|
-
|
|
9168
|
+
--nav-list-rail-inset: calc((var(--nav-list-icon-size, 1em) - var(--border-width)) / 2);
|
|
9169
|
+
margin-inline-start: calc(var(--space-20) + var(--nav-list-rail-inset));
|
|
9170
|
+
padding-inline-start: var(--nav-list-rail-inset);
|
|
9171
|
+
border-inline-start: var(--border-width) solid var(--nav-list-rail-color, var(--border));
|
|
9114
9172
|
}
|
|
9115
9173
|
|
|
9116
9174
|
/* Forced colors drops the fill and maps both inks to LinkText, so the current
|
|
@@ -9872,11 +9930,13 @@ a.avatar[aria-disabled="true"] {
|
|
|
9872
9930
|
*/
|
|
9873
9931
|
|
|
9874
9932
|
@supports selector(.scrollspy a:target-current) {
|
|
9875
|
-
.
|
|
9933
|
+
/* Native and JS activation lines can select different links. Once JS has
|
|
9934
|
+
a current location, it owns the state and the native group must yield. */
|
|
9935
|
+
.scrollspy:not(:has([aria-current="location"])) {
|
|
9876
9936
|
scroll-target-group: auto;
|
|
9877
9937
|
}
|
|
9878
9938
|
|
|
9879
|
-
.scrollspy a:target-current {
|
|
9939
|
+
.scrollspy:not(:has([aria-current="location"])) a:target-current {
|
|
9880
9940
|
color: var(--text);
|
|
9881
9941
|
font-weight: var(--font-weight-medium);
|
|
9882
9942
|
}
|
|
@@ -10465,6 +10525,11 @@ a.list-item:is([aria-current="page"], [aria-current="true"])::before {
|
|
|
10465
10525
|
* follows the animated gradient, so a rotating aura repaints one blurred layer
|
|
10466
10526
|
* per frame, not two.
|
|
10467
10527
|
*
|
|
10528
|
+
* Per-frame cost is the registered --aura-angle animation itself: style and a
|
|
10529
|
+
* full repaint every frame, off screen too. Containment and a static near
|
|
10530
|
+
* halo do not change it; a compositor rotation needs an extra element. Measured
|
|
10531
|
+
* in docs/design-notes/motion-cost.md (bun run report:paint).
|
|
10532
|
+
*
|
|
10468
10533
|
* Public hooks:
|
|
10469
10534
|
* --aura-color
|
|
10470
10535
|
* --aura-width
|
|
@@ -10648,6 +10713,138 @@ a.list-item:is([aria-current="page"], [aria-current="true"])::before {
|
|
|
10648
10713
|
--aura-radius: var(--radius-full);
|
|
10649
10714
|
}
|
|
10650
10715
|
|
|
10716
|
+
/*
|
|
10717
|
+
* Mark sweep — a highlight that sweeps in behind a phrase.
|
|
10718
|
+
*
|
|
10719
|
+
* Docs: docs/pages/components/mark-sweep.md
|
|
10720
|
+
*
|
|
10721
|
+
* <mark> carries the semantics of contextually relevant text and is styled by
|
|
10722
|
+
* base.css. `.mark-sweep` is the effect alone and composes on any inline
|
|
10723
|
+
* element. Both read the same --mark-bg / --mark-fg pair, so a theme or an
|
|
10724
|
+
* intent retints the phrase and its sweep together, without a second palette.
|
|
10725
|
+
*
|
|
10726
|
+
* The highlight is a full-size background image at rest. `is-pending` shrinks
|
|
10727
|
+
* it to zero and the transition grows it back from the reading direction's
|
|
10728
|
+
* start edge. Without JavaScript, under reduced motion and in print, the full
|
|
10729
|
+
* highlight is already there.
|
|
10730
|
+
*
|
|
10731
|
+
* Public hooks:
|
|
10732
|
+
* --mark-sweep-duration
|
|
10733
|
+
*/
|
|
10734
|
+
.mark-sweep {
|
|
10735
|
+
--mark-sweep-duration: 700ms;
|
|
10736
|
+
|
|
10737
|
+
/* The shorthand is deliberate: it also clears the background-color base.css
|
|
10738
|
+
paints on <mark>, which would otherwise show the whole highlight while
|
|
10739
|
+
the element is pending. */
|
|
10740
|
+
background: linear-gradient(var(--mark-bg), var(--mark-bg)) 0 0 / 100% 100% no-repeat;
|
|
10741
|
+
color: var(--mark-fg);
|
|
10742
|
+
}
|
|
10743
|
+
|
|
10744
|
+
/* The zero-width box is anchored to the reading direction's start edge. Only
|
|
10745
|
+
the anchor changes under RTL; the gradient itself is symmetric. */
|
|
10746
|
+
.mark-sweep:dir(rtl) {
|
|
10747
|
+
background-position: 100% 0;
|
|
10748
|
+
}
|
|
10749
|
+
|
|
10750
|
+
/* Solid intent ink needs its fill to stay legible. A sweep exposes the surface
|
|
10751
|
+
until the fill arrives, so use a soft tint with ordinary theme ink instead.
|
|
10752
|
+
Guard the custom property: unsupported color-mix() would invalidate the
|
|
10753
|
+
background at computed time instead of preserving the theme highlight. */
|
|
10754
|
+
@supports (color: color-mix(in oklab, red, white)) {
|
|
10755
|
+
.mark-sweep:is(.primary, .secondary, .success, .warning, .danger, .neutral) {
|
|
10756
|
+
--mark-bg: color-mix(in oklab, var(--surface) var(--soft-bg-mix), var(--intent));
|
|
10757
|
+
--mark-fg: var(--text);
|
|
10758
|
+
}
|
|
10759
|
+
}
|
|
10760
|
+
|
|
10761
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
10762
|
+
.mark-sweep {
|
|
10763
|
+
/* A readable sweep needs a gentler start than surface entrance timing. */
|
|
10764
|
+
transition: background-size var(--mark-sweep-duration) ease-out;
|
|
10765
|
+
}
|
|
10766
|
+
|
|
10767
|
+
.mark-sweep.is-pending {
|
|
10768
|
+
background-size: 0 100%;
|
|
10769
|
+
}
|
|
10770
|
+
}
|
|
10771
|
+
|
|
10772
|
+
/* Forced colors drops the background image, so the system Mark pair keeps the
|
|
10773
|
+
phrase distinct whether .mark-sweep sits on <mark> or a <span>. */
|
|
10774
|
+
@media (forced-colors: active) {
|
|
10775
|
+
.mark-sweep {
|
|
10776
|
+
background: Mark;
|
|
10777
|
+
color: MarkText;
|
|
10778
|
+
}
|
|
10779
|
+
}
|
|
10780
|
+
|
|
10781
|
+
/*
|
|
10782
|
+
* Reveal — entrance motion for a block or a group of children.
|
|
10783
|
+
*
|
|
10784
|
+
* Docs: docs/pages/components/reveal.md
|
|
10785
|
+
*
|
|
10786
|
+
* The entrance is a one-shot animation, so `.reveal` alone plays it on the
|
|
10787
|
+
* first render, without JavaScript. in-view.js adds the scroll trigger: it
|
|
10788
|
+
* writes `is-pending` on an element that waits outside the viewport, and this
|
|
10789
|
+
* file holds it hidden with the animation removed. Removing the class puts the
|
|
10790
|
+
* animation back, which starts it from the beginning on the first appearance.
|
|
10791
|
+
*
|
|
10792
|
+
* Everything sits under `screen and (prefers-reduced-motion: no-preference)`:
|
|
10793
|
+
* reduced motion and print neither animate nor hide anything.
|
|
10794
|
+
*
|
|
10795
|
+
* An animation rather than a transition, on purpose: the `transition`
|
|
10796
|
+
* shorthand replaced the transitions of the component it sat on (a `.btn`
|
|
10797
|
+
* lost its hover motion). The `animation` shorthand still replaces another
|
|
10798
|
+
* animation on the same element, which is the remaining composition limit.
|
|
10799
|
+
*
|
|
10800
|
+
* Fill mode `backwards` holds the first keyframe through a stagger delay and
|
|
10801
|
+
* leaves no animated value in the cascade once the entrance ends. A pending
|
|
10802
|
+
* element revealed by focus has its new animation finished by in-view.js,
|
|
10803
|
+
* because a :focus-within override lapses on blur and replays the entrance.
|
|
10804
|
+
*
|
|
10805
|
+
* Public hooks:
|
|
10806
|
+
* --reveal-duration
|
|
10807
|
+
* --reveal-distance
|
|
10808
|
+
* --reveal-stagger
|
|
10809
|
+
*/
|
|
10810
|
+
.reveal,
|
|
10811
|
+
.reveal-group {
|
|
10812
|
+
--reveal-duration: 450ms;
|
|
10813
|
+
--reveal-distance: 1rem;
|
|
10814
|
+
--reveal-stagger: 60ms;
|
|
10815
|
+
}
|
|
10816
|
+
|
|
10817
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
10818
|
+
.reveal,
|
|
10819
|
+
.reveal-group > * {
|
|
10820
|
+
/* The gentler ease-out keeps the fade gradual; surface entrance timing
|
|
10821
|
+
makes most of the content visible too early. */
|
|
10822
|
+
animation: actual-reveal var(--reveal-duration) ease-out backwards;
|
|
10823
|
+
}
|
|
10824
|
+
|
|
10825
|
+
/* The cap keeps a long list from becoming an endless cascade: the ninth and
|
|
10826
|
+
later items share the eighth step's delay. An engine without
|
|
10827
|
+
sibling-index() drops this declaration alone and reveals the group
|
|
10828
|
+
together, which is the intended degradation. */
|
|
10829
|
+
.reveal-group > * {
|
|
10830
|
+
animation-delay: calc(min(sibling-index() - 1, 8) * var(--reveal-stagger));
|
|
10831
|
+
}
|
|
10832
|
+
|
|
10833
|
+
.reveal.is-pending,
|
|
10834
|
+
.reveal-group.is-pending > * {
|
|
10835
|
+
animation: none;
|
|
10836
|
+
opacity: 0;
|
|
10837
|
+
}
|
|
10838
|
+
}
|
|
10839
|
+
|
|
10840
|
+
/* The end keyframe is implicit: the element's own opacity and translate. */
|
|
10841
|
+
@keyframes actual-reveal {
|
|
10842
|
+
from {
|
|
10843
|
+
opacity: 0;
|
|
10844
|
+
translate: 0 var(--reveal-distance);
|
|
10845
|
+
}
|
|
10846
|
+
}
|
|
10847
|
+
|
|
10651
10848
|
/*
|
|
10652
10849
|
* Highlight sweeping across a text label — an activity in progress.
|
|
10653
10850
|
*
|
|
@@ -10660,6 +10857,9 @@ a.list-item:is([aria-current="page"], [aria-current="true"])::before {
|
|
|
10660
10857
|
* Public hooks:
|
|
10661
10858
|
* --shimmer-color
|
|
10662
10859
|
* --shimmer-highlight
|
|
10860
|
+
*
|
|
10861
|
+
* Internal:
|
|
10862
|
+
* --shimmer-band
|
|
10663
10863
|
*/
|
|
10664
10864
|
.shimmer {
|
|
10665
10865
|
--shimmer-color: var(--text-muted);
|
|
@@ -10674,34 +10874,49 @@ a.list-item:is([aria-current="page"], [aria-current="true"])::before {
|
|
|
10674
10874
|
the fill, not `color`: a label class that sets its own color (.muted, a
|
|
10675
10875
|
caption style) would otherwise win the cascade and paint opaque glyphs over
|
|
10676
10876
|
the sweep. Reduced motion keeps the plain label — a frozen band would read
|
|
10677
|
-
as a random tint.
|
|
10877
|
+
as a random tint.
|
|
10878
|
+
|
|
10879
|
+
The band has a fixed width in em, not a share of the label: a proportional
|
|
10880
|
+
band covered most of a short label like "Working…" and lit the whole word
|
|
10881
|
+
instead of crossing it. */
|
|
10678
10882
|
@supports (background-clip: text) {
|
|
10679
10883
|
@media (prefers-reduced-motion: no-preference) {
|
|
10680
10884
|
.shimmer {
|
|
10885
|
+
--shimmer-band: 1.25em;
|
|
10886
|
+
|
|
10681
10887
|
-webkit-text-fill-color: transparent;
|
|
10682
10888
|
background:
|
|
10683
10889
|
linear-gradient(
|
|
10684
10890
|
90deg,
|
|
10685
|
-
var(--shimmer-color)
|
|
10891
|
+
var(--shimmer-color) calc(50% - var(--shimmer-band)),
|
|
10686
10892
|
var(--shimmer-highlight) 50%,
|
|
10687
|
-
var(--shimmer-color)
|
|
10893
|
+
var(--shimmer-color) calc(50% + var(--shimmer-band))
|
|
10688
10894
|
)
|
|
10689
|
-
0 0 /
|
|
10895
|
+
0 0 / calc(200% + 2 * var(--shimmer-band)) 100%;
|
|
10690
10896
|
background-clip: text;
|
|
10691
|
-
animation: actual-shimmer var(--duration-shimmer)
|
|
10897
|
+
animation: actual-shimmer var(--duration-shimmer) ease-in-out infinite;
|
|
10898
|
+
}
|
|
10899
|
+
|
|
10900
|
+
/* The sweep follows the reading direction. Reversing also moves the rest
|
|
10901
|
+
to the start of the cycle, which reads the same in a loop. */
|
|
10902
|
+
.shimmer:dir(rtl) {
|
|
10903
|
+
animation-direction: reverse;
|
|
10692
10904
|
}
|
|
10693
10905
|
}
|
|
10694
10906
|
}
|
|
10695
10907
|
|
|
10696
|
-
/*
|
|
10697
|
-
|
|
10698
|
-
|
|
10908
|
+
/* A background of twice the label plus the band puts the band's far edge at
|
|
10909
|
+
the label's start at 100% and its near edge at the label's end at 0%, so
|
|
10910
|
+
every pass enters and leaves completely, whatever the label's length. The
|
|
10911
|
+
last quarter rests off the label: a continuous sweep reads as a machine,
|
|
10912
|
+
the rest between passes as a breath. */
|
|
10699
10913
|
@keyframes actual-shimmer {
|
|
10700
|
-
|
|
10914
|
+
0% {
|
|
10701
10915
|
background-position: 100% 0;
|
|
10702
10916
|
}
|
|
10703
10917
|
|
|
10704
|
-
|
|
10918
|
+
75%,
|
|
10919
|
+
100% {
|
|
10705
10920
|
background-position: 0% 0;
|
|
10706
10921
|
}
|
|
10707
10922
|
}
|