actual-css 0.20.0 → 0.20.2
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 +36 -0
- package/components.json +10 -3
- package/dist/actual.full.css +110 -20
- package/dist/actual.full.js +2 -2
- package/dist/actual.full.min.css +1 -1
- package/dist/types/tooltip.d.ts +4 -0
- package/docs/pages/components/button.md +10 -0
- package/docs/pages/components/meter.md +1 -0
- package/docs/pages/components/progress.md +1 -0
- package/docs/pages/components/timeline.md +32 -0
- package/docs/pages/enhancements/tooltip.md +5 -1
- package/docs/pages/examples/overview.md +1 -0
- package/docs/pages/forms/combobox.md +4 -2
- package/docs/pages/forms/range.md +3 -1
- package/docs/pages/guides/progressive-enhancement.md +22 -0
- package/package.json +3 -1
- package/reserved-classes.json +1 -0
- package/src/css/components/avatar.css +1 -0
- package/src/css/components/button.css +2 -2
- package/src/css/components/flyout.css +3 -0
- package/src/css/components/meter.css +21 -6
- package/src/css/components/progress.css +5 -4
- package/src/css/components/rating.css +2 -0
- package/src/css/components/timeline.css +53 -2
- package/src/css/core/tokens.css +4 -0
- package/src/css/forms/choice-card.css +2 -1
- package/src/css/forms/otp.css +5 -0
- package/src/css/forms/range.css +11 -5
- package/src/css/forms/select.css +1 -0
- package/src/js/dialog.js +19 -0
- package/src/js/tooltip.js +64 -2
- package/src/tooling/design-tokens.js +1 -1
- package/tokens.json +1 -0
package/dist/types/tooltip.d.ts
CHANGED
|
@@ -63,6 +63,10 @@ export type TooltipState = {
|
|
|
63
63
|
* Pointer is over the tooltip.
|
|
64
64
|
*/
|
|
65
65
|
overTip: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* A touch tap pinned the tip open.
|
|
68
|
+
*/
|
|
69
|
+
tapped: boolean;
|
|
66
70
|
};
|
|
67
71
|
/** True while the tip is promoted. The runtime's state, not :popover-open. */
|
|
68
72
|
export declare function isTooltipVisible(tip: any): boolean;
|
|
@@ -214,6 +214,16 @@ and typography together; `.compact` and `.spacious` only change density.
|
|
|
214
214
|
</div>
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
+
### Label weight
|
|
218
|
+
|
|
219
|
+
A distinct `500` (medium) label needs a font face at that weight or a
|
|
220
|
+
variable font whose weight axis includes it. When `400` and `600` are the
|
|
221
|
+
nearest available weights, the browser renders `500` using `400`.
|
|
222
|
+
|
|
223
|
+
If the font stack lacks `500`, set `font-weight` on `.btn` in your theme.
|
|
224
|
+
Choose `400` (`--font-weight-normal`) for a quieter label or `600`
|
|
225
|
+
(`--font-weight-semibold`) for more emphasis.
|
|
226
|
+
|
|
217
227
|
## States
|
|
218
228
|
|
|
219
229
|
### Compact filters and actions
|
|
@@ -73,6 +73,7 @@ marker to that background rather than to the neutral intent.
|
|
|
73
73
|
- `--meter-track` — track color; raise it when the meter sits on a
|
|
74
74
|
`--surface-subtle` card, where the default track would disappear.
|
|
75
75
|
- `--bar-height` — bar thickness, shared with `.progress`.
|
|
76
|
+
- `--bar-radius` — corner of the track and the value, shared with `.progress`; `0` squares the bar.
|
|
76
77
|
- `--meter-value` — relative weight of a direct child in a segmented meter.
|
|
77
78
|
|
|
78
79
|
`.sm` / `.lg` are intentionally not supported: a bar keeps its inline size and only changes
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
- `--progress-track` — unfilled track color.
|
|
33
33
|
- `--progress-value` — filled bar color. Prefer an intent class over setting this directly.
|
|
34
34
|
- `--bar-height` — bar thickness, shared with `.meter`.
|
|
35
|
+
- `--bar-radius` — corner of the track and the value, shared with `.meter`; `0` squares the bar.
|
|
35
36
|
|
|
36
37
|
`.sm` / `.lg` are intentionally not supported: a bar keeps its inline size and only changes
|
|
37
38
|
thickness, and a design asks for a 4px or a 12px bar, not for a "small" one. Set the hook
|
|
@@ -170,6 +170,38 @@ from assistive technology.
|
|
|
170
170
|
</section>
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
+
## Dates at the start
|
|
174
|
+
|
|
175
|
+
`.timeline-dates-start` sets every `<time>` in a column before the rail, as a
|
|
176
|
+
log or an audit trail reads: the eye runs down the times, then across to the
|
|
177
|
+
events. The column is as wide as the longest dateline, so every rail lines up
|
|
178
|
+
whatever the dates say, and the list keeps that alignment in a wide column.
|
|
179
|
+
|
|
180
|
+
Write the `<time>` first, after an optional icon or avatar, and make every
|
|
181
|
+
other piece of the event an element: bare text beside the time would become
|
|
182
|
+
its own grid item. Wrap a sentence that mixes text and links in one `<span>`
|
|
183
|
+
or `<p>`. Without subgrid support the dateline stays above the title.
|
|
184
|
+
|
|
185
|
+
```html demo
|
|
186
|
+
<ol class="timeline timeline-dates-start">
|
|
187
|
+
<li>
|
|
188
|
+
<time datetime="2026-11-22T21:04">21:04</time>
|
|
189
|
+
<strong>Mara Voss</strong>
|
|
190
|
+
<p class="muted">Posted the job: a ledger out of the archive annex.</p>
|
|
191
|
+
</li>
|
|
192
|
+
<li class="primary">
|
|
193
|
+
<time datetime="2026-11-22T21:32">21:32</time>
|
|
194
|
+
<strong>Ghostwrite</strong>
|
|
195
|
+
<p class="muted">Rewrote the badge log for the service lift.</p>
|
|
196
|
+
</li>
|
|
197
|
+
<li class="warning">
|
|
198
|
+
<time datetime="2026-11-21">Yesterday</time>
|
|
199
|
+
<strong>Relay</strong>
|
|
200
|
+
<p class="muted">Trace detected on node 3F. <a href="#">Link rerouted</a>.</p>
|
|
201
|
+
</li>
|
|
202
|
+
</ol>
|
|
203
|
+
```
|
|
204
|
+
|
|
173
205
|
## Activity feed
|
|
174
206
|
|
|
175
207
|
Avatars as markers, the actor and verb as one sentence, and richer content
|
|
@@ -14,6 +14,8 @@ by promoting it to the top layer with `popover="manual"`.
|
|
|
14
14
|
tooltip. Use a [flyout](flyout.md#contextual-help) for contextual help with
|
|
15
15
|
links or buttons.
|
|
16
16
|
- Show on hover and keyboard focus. Hide on Escape, blur, pointer leave, or a pointer press on the trigger.
|
|
17
|
+
- On touch, a tap opens the tooltip and still activates the trigger. A second tap, a tap elsewhere, Escape, or a dialog or popover opening closes it.
|
|
18
|
+
- Add `data-tooltip-no-tap` when the tooltip only repeats the trigger's accessible name, such as an icon button's `aria-label`: the tap then just runs the action.
|
|
17
19
|
- A trigger scrolled out of view takes its tooltip down and brings it back when it returns; only a dismissal ends the tooltip.
|
|
18
20
|
- Escape dismisses the tooltip without moving the pointer or focus (WCAG 2.1 SC 1.4.13).
|
|
19
21
|
- After Escape or a pointer press dismisses a hover or focus tooltip, move the pointer away and back or return with keyboard focus to show it again.
|
|
@@ -90,7 +92,9 @@ floating content contains controls.
|
|
|
90
92
|
The `data-tooltip="…"` shorthand is intentionally plain text. For trusted HTML,
|
|
91
93
|
use an explicit tooltip referenced by `aria-describedby`. Keep its content
|
|
92
94
|
non-interactive and concise; long content wraps up to the tooltip's
|
|
93
|
-
viewport-aware maximum width.
|
|
95
|
+
viewport-aware maximum width. A hover card (preview card, profile peek) is the
|
|
96
|
+
same explicit tooltip with a richer body; once it holds links or buttons, it is
|
|
97
|
+
a flyout.
|
|
94
98
|
|
|
95
99
|
```html demo
|
|
96
100
|
<button class="btn" type="button"
|
|
@@ -38,6 +38,7 @@ Whole pages, composed the way a real product would.
|
|
|
38
38
|
- [iOS-style settings](../../demo/templates/settings-ios.html) - iOS-like controls and grouped settings from unchanged framework markup, a local theme, and its findings listed rule by rule
|
|
39
39
|
- [Card compositions](../../demo/templates/card-compositions.html) - editorial, team, sign-in and horizontal cards composed from existing primitives
|
|
40
40
|
- [Neo-brutalist](../../demo/templates/neo-brutalist.html) - a risograph print studio on the `neo-brutalist` theme (order alerts, plus-marker FAQ, ruled testimonial grid, docked cookie banner) with the page loading its own fonts
|
|
41
|
+
- [Cyberdeck](../../demo/templates/cyberdeck.html) - a relay station console on the `cyberdeck` theme (bevelled frames, segmented gauges, diamond markers, printed switch states, link-card reticle) with page-level micro-print
|
|
41
42
|
- [Register form](../../demo/templates/register-form.html) - registration page with choice cards, masks, the password toggle, `tel-prefix` validation, an OTP verification dialog, and status feedback
|
|
42
43
|
|
|
43
44
|
### Layout references
|
|
@@ -72,7 +72,7 @@ contrast contracts apply to the combobox for free:
|
|
|
72
72
|
.actual-combobox {
|
|
73
73
|
--cb-bg: var(--control-default-bg, var(--surface));
|
|
74
74
|
--cb-color: var(--text);
|
|
75
|
-
--cb-border-color: var(--form-invalid-border, var(--border));
|
|
75
|
+
--cb-border-color: var(--form-invalid-border, var(--control-default-border, var(--border-control)));
|
|
76
76
|
--cb-border-radius: var(--radius);
|
|
77
77
|
--cb-focus-color: var(--focus);
|
|
78
78
|
--cb-muted-color: var(--text-muted);
|
|
@@ -121,7 +121,9 @@ turn danger together.
|
|
|
121
121
|
|
|
122
122
|
### Limits
|
|
123
123
|
|
|
124
|
-
The bridge shares the inherited resting field fill through
|
|
124
|
+
The bridge shares the inherited resting field fill and edge through
|
|
125
|
+
`--control-default-bg` and `--control-default-border`, falling back to
|
|
126
|
+
`--surface` and `--border-control` like `.input`.
|
|
125
127
|
It follows tokens, not native-control selectors: local `--control-bg` overrides
|
|
126
128
|
and theme-specific invalid or disabled fills need matching widget state rules.
|
|
127
129
|
|
|
@@ -127,7 +127,9 @@ deletion once `::slider-fill` is interoperable — see
|
|
|
127
127
|
|
|
128
128
|
## CSS hooks
|
|
129
129
|
|
|
130
|
-
- `--range-thumb-size` — thumb
|
|
130
|
+
- `--range-thumb-size` — thumb height, which is also the control's height.
|
|
131
|
+
- `--range-thumb-inline-size` — thumb width; follows `--range-thumb-size` (a round thumb) unless set.
|
|
132
|
+
- `--range-thumb-radius` — thumb corner; `0` with a narrower width makes a block thumb. The focus ring follows both.
|
|
131
133
|
- `--range-track-height` — track thickness.
|
|
132
134
|
- `--range-thumb-bg` — thumb color. Defaults to the local intent, then `--primary`.
|
|
133
135
|
- `--range-track-bg` — track color.
|
|
@@ -590,6 +590,28 @@ connect function receives the element plus `{ config, signal, emit }`; `emit`
|
|
|
590
590
|
dispatches `actual:<name>:<type>` events. Connect must be synchronous and may
|
|
591
591
|
return a cleanup function or nothing; the loader owns the AbortController.
|
|
592
592
|
|
|
593
|
+
#### Without a build
|
|
594
|
+
|
|
595
|
+
The plain `<script src="actual.full.js">` bundle exposes no global, so a page
|
|
596
|
+
without a bundler cannot call `registerEnhancement()`. It does not need to: the
|
|
597
|
+
bundle watches manifests, so a page declares its own module and the runtime
|
|
598
|
+
imports and registers it, on the same lifecycle as the built-in behaviors.
|
|
599
|
+
|
|
600
|
+
```html
|
|
601
|
+
<script type="application/json" data-enhance-modules>
|
|
602
|
+
{ "autosubmit": "/js/autosubmit.js" }
|
|
603
|
+
</script>
|
|
604
|
+
<script src="/dist/actual.full.js" defer></script>
|
|
605
|
+
|
|
606
|
+
<form data-enhance="autosubmit">…</form>
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
`/js/autosubmit.js` is an ES module with the default export shown above; no
|
|
610
|
+
import of Actual is needed. Serve the page over HTTP: browsers refuse module
|
|
611
|
+
imports from a page opened as `file://`, and the behavior silently never
|
|
612
|
+
connects. A behavior that owns its own attribute instead of a
|
|
613
|
+
`data-enhance` token can stay a classic script.
|
|
614
|
+
|
|
593
615
|
`loadScript(url)` and `loadStyle(url)` are public helpers for non-ESM assets.
|
|
594
616
|
Names are reserved once per manifest set — redeclaring a name from a different
|
|
595
617
|
URL throws, and duplicate declarations share one import promise. The
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "actual-css",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.2",
|
|
4
4
|
"description": "Plain CSS component framework with semantic classes, universal variants, small tokens, theme hooks, and progressive enhancements.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "bun@1.4.4",
|
|
@@ -160,6 +160,7 @@
|
|
|
160
160
|
"release": "bun scripts/release.js",
|
|
161
161
|
"release:notes": "bun scripts/release-notes.js",
|
|
162
162
|
"test": "bun test",
|
|
163
|
+
"test:browsers": "bun scripts/test-browsers.js",
|
|
163
164
|
"test:changed": "bun test --changed=master",
|
|
164
165
|
"build:all": "bun run lint && bun run build:dist && bun run build:js && bun run build:types && bun run build:size && bun run format:docs && bun run build:docs && bun run check:docs && bun run check:doc-classes && bun run check:compat && bun run check:css-api && bun run check:color-space && bun run check:architecture && bun run check:enhance && bun run generate:reserved && bun run check:reserved && bun run generate:catalog && bun run check:catalog && bun run check:sync && bun run check:links && bun run check:templates && bun run test",
|
|
165
166
|
"prepublishOnly": "bun run build:all"
|
|
@@ -167,6 +168,7 @@
|
|
|
167
168
|
"devDependencies": {
|
|
168
169
|
"@biomejs/biome": "^2.5.15",
|
|
169
170
|
"happy-dom": "^21.0.1",
|
|
171
|
+
"playwright": "1.65.1",
|
|
170
172
|
"typescript": "^7.0.0"
|
|
171
173
|
},
|
|
172
174
|
"dependencies": {
|
package/reserved-classes.json
CHANGED
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
select it, so an author can also set it on a container. */
|
|
96
96
|
font-size: var(--btn-font-size, var(--control-font-size));
|
|
97
97
|
/* why: medium at one step below the field text. Medium at the field text
|
|
98
|
-
size read dense
|
|
99
|
-
|
|
98
|
+
size read dense in Chromium on Windows (system-ui draws 500 like 600).
|
|
99
|
+
Regular read lighter than the medium field labels. */
|
|
100
100
|
font-weight: var(--font-weight-medium);
|
|
101
101
|
/* why: 1.25, not 1: a wrapped label's lines touched at 1. A single line
|
|
102
102
|
keeps its height, since padding-block is derived from 1lh above. */
|
|
@@ -97,6 +97,9 @@
|
|
|
97
97
|
.flyout[popover] {
|
|
98
98
|
position: fixed;
|
|
99
99
|
inset: auto;
|
|
100
|
+
/* why: the UA's height: fit-content made Safari 18 size this grid to its
|
|
101
|
+
max-block-size and spread the spare room between menu rows. */
|
|
102
|
+
block-size: auto;
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
/* A presentation class may own its *visible* display type, but must not
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* --meter-track
|
|
15
15
|
* --meter-value
|
|
16
16
|
* --bar-height
|
|
17
|
+
* --bar-radius
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
.meter {
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
block-size: var(--bar-height);
|
|
27
28
|
overflow: hidden;
|
|
28
29
|
border: 0;
|
|
29
|
-
border-radius: var(--radius
|
|
30
|
+
border-radius: var(--bar-radius);
|
|
30
31
|
background: var(--meter-track);
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -53,31 +54,45 @@
|
|
|
53
54
|
-webkit-appearance: none;
|
|
54
55
|
block-size: var(--bar-height);
|
|
55
56
|
border: 0;
|
|
56
|
-
border-radius: var(--radius
|
|
57
|
+
border-radius: var(--bar-radius);
|
|
57
58
|
background: var(--meter-track);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
.meter::-webkit-meter-optimum-value {
|
|
61
62
|
block-size: var(--bar-height);
|
|
62
|
-
border-radius: var(--radius
|
|
63
|
+
border-radius: var(--bar-radius);
|
|
63
64
|
background: var(--success);
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
.meter::-webkit-meter-suboptimum-value {
|
|
67
68
|
block-size: var(--bar-height);
|
|
68
|
-
border-radius: var(--radius
|
|
69
|
+
border-radius: var(--bar-radius);
|
|
69
70
|
background: var(--warning);
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
.meter::-webkit-meter-even-less-good-value {
|
|
73
74
|
block-size: var(--bar-height);
|
|
74
|
-
border-radius: var(--radius
|
|
75
|
+
border-radius: var(--bar-radius);
|
|
75
76
|
background: var(--danger);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
.meter::-moz-meter-bar {
|
|
79
80
|
block-size: var(--bar-height);
|
|
80
|
-
border-radius: var(--radius
|
|
81
|
+
border-radius: var(--bar-radius);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* The background shorthand clears Gecko's native gradient. Keep state
|
|
85
|
+
specificity inside :where() so Highlight can still override the fill. */
|
|
86
|
+
.meter:where(:-moz-meter-optimum)::-moz-meter-bar {
|
|
87
|
+
background: var(--success);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.meter:where(:-moz-meter-sub-optimum)::-moz-meter-bar {
|
|
91
|
+
background: var(--warning);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.meter:where(:-moz-meter-sub-sub-optimum)::-moz-meter-bar {
|
|
95
|
+
background: var(--danger);
|
|
81
96
|
}
|
|
82
97
|
|
|
83
98
|
@media (forced-colors: active) {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* --progress-track
|
|
15
15
|
* --progress-value
|
|
16
16
|
* --bar-height
|
|
17
|
+
* --bar-radius
|
|
17
18
|
*/
|
|
18
19
|
/* Intent boundary — inherited intents do not tint this component.
|
|
19
20
|
Local intent classes still win because :where() has zero specificity. */
|
|
@@ -32,25 +33,25 @@
|
|
|
32
33
|
block-size: var(--bar-height);
|
|
33
34
|
overflow: hidden;
|
|
34
35
|
border: 0;
|
|
35
|
-
border-radius: var(--radius
|
|
36
|
+
border-radius: var(--bar-radius);
|
|
36
37
|
background: var(--progress-track);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
.progress::-webkit-progress-bar {
|
|
40
41
|
block-size: var(--bar-height);
|
|
41
|
-
border-radius: var(--radius
|
|
42
|
+
border-radius: var(--bar-radius);
|
|
42
43
|
background: var(--progress-track);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
.progress::-webkit-progress-value {
|
|
46
47
|
block-size: var(--bar-height);
|
|
47
|
-
border-radius: var(--radius
|
|
48
|
+
border-radius: var(--bar-radius);
|
|
48
49
|
background: var(--progress-value);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
.progress::-moz-progress-bar {
|
|
52
53
|
block-size: var(--bar-height);
|
|
53
|
-
border-radius: var(--radius
|
|
54
|
+
border-radius: var(--bar-radius);
|
|
54
55
|
background: var(--progress-value);
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
.rating > input[type="radio"] {
|
|
69
69
|
appearance: none;
|
|
70
|
+
-webkit-appearance: none;
|
|
70
71
|
flex: 0 0 auto;
|
|
71
72
|
inline-size: calc(var(--rating-size) + var(--rating-gap));
|
|
72
73
|
/* Taller than the star: the hit area grows, the drawing does not. */
|
|
@@ -212,6 +213,7 @@
|
|
|
212
213
|
@media (forced-colors: active) {
|
|
213
214
|
.rating > input[type="radio"] {
|
|
214
215
|
appearance: auto;
|
|
216
|
+
-webkit-appearance: auto;
|
|
215
217
|
inline-size: auto;
|
|
216
218
|
block-size: auto;
|
|
217
219
|
background: Canvas;
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* block flow, so a sentence mixing text and links is never split into items.
|
|
18
18
|
*
|
|
19
19
|
* .timeline-dates-end moves every dateline to the inline end of the event's
|
|
20
|
-
* first line, beside the title instead of above it.
|
|
20
|
+
* first line, beside the title instead of above it. .timeline-dates-start sets
|
|
21
|
+
* them in a shared column before the rail.
|
|
21
22
|
*
|
|
22
23
|
* Progress through a process is .steps, not a timeline.
|
|
23
24
|
*
|
|
@@ -126,7 +127,9 @@
|
|
|
126
127
|
min-block-size: calc(var(--timeline-marker-center) + var(--timeline-rail-size) / 2);
|
|
127
128
|
padding-block-start: var(--timeline-marker-inset);
|
|
128
129
|
padding-inline-start: calc(var(--timeline-rail-size) + var(--timeline-inline-gap));
|
|
129
|
-
|
|
130
|
+
/* Firefox falls back to the registered property's initial 0px when its em
|
|
131
|
+
length sets line-height. Compute the inherited length directly. */
|
|
132
|
+
line-height: calc(var(--line-height) * 1em);
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
/* The event owns no rhythm beyond its dateline: block children drop their own
|
|
@@ -172,6 +175,54 @@
|
|
|
172
175
|
font-size: calc(var(--timeline-line-box) / var(--line-height));
|
|
173
176
|
}
|
|
174
177
|
|
|
178
|
+
/* Dates at the start: the datelines form a column before the rail, as in a
|
|
179
|
+
log. The list owns three tracks (dateline, rail, event) and every event
|
|
180
|
+
takes them as a subgrid, so the column is as wide as its longest dateline
|
|
181
|
+
and every rail lines up. The marker, the segment and a slot stay absolutely
|
|
182
|
+
positioned: placed in the rail track, that track becomes their containing
|
|
183
|
+
block, and the offsets above hold unchanged.
|
|
184
|
+
|
|
185
|
+
Contract: after the <time>, every piece of the event is an element. A
|
|
186
|
+
grid makes each run of bare text an item of its own, which could land in
|
|
187
|
+
the dateline track.
|
|
188
|
+
|
|
189
|
+
Guarded: without subgrid these rules would leave each event a lone grid
|
|
190
|
+
that scatters its children; the fallback is the default dateline above
|
|
191
|
+
the title. */
|
|
192
|
+
@supports (grid-template-columns: subgrid) {
|
|
193
|
+
.timeline-dates-start {
|
|
194
|
+
grid-template-columns: max-content var(--timeline-rail-size) minmax(0, 1fr);
|
|
195
|
+
column-gap: var(--timeline-inline-gap);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.timeline-dates-start > li {
|
|
199
|
+
display: grid;
|
|
200
|
+
grid-column: 1 / -1;
|
|
201
|
+
grid-template-columns: subgrid;
|
|
202
|
+
/* The smaller dateline shares the title's baseline on the first row. */
|
|
203
|
+
align-items: first baseline;
|
|
204
|
+
padding-inline-start: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.timeline-dates-start > li > * {
|
|
208
|
+
grid-column: 3;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* Row 1, so the dateline sits beside the title rather than above it, and
|
|
212
|
+
end-aligned, so ragged datelines hug the rail. */
|
|
213
|
+
.timeline-dates-start > li > time {
|
|
214
|
+
grid-row: 1;
|
|
215
|
+
grid-column: 1;
|
|
216
|
+
text-align: end;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.timeline-dates-start > li::before,
|
|
220
|
+
.timeline-dates-start > li::after,
|
|
221
|
+
.timeline-dates-start > li > :is(.avatar, [aria-hidden="true"]):first-child {
|
|
222
|
+
grid-column: 2;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
175
226
|
.timeline > li::before {
|
|
176
227
|
content: "";
|
|
177
228
|
position: absolute;
|
package/src/css/core/tokens.css
CHANGED
|
@@ -106,6 +106,10 @@
|
|
|
106
106
|
the same geometry. Public: set it on the element or on an application
|
|
107
107
|
class rather than reaching for a size variant. */
|
|
108
108
|
--bar-height: 0.65rem;
|
|
109
|
+
/* Their corner, track and value alike. The value is drawn on vendor
|
|
110
|
+
pseudo-elements a theme cannot reach in one rule, so this is the way to
|
|
111
|
+
square a bar. */
|
|
112
|
+
--bar-radius: var(--radius-full);
|
|
109
113
|
|
|
110
114
|
/* Controls — inputs and buttons share --control-size so heights always match.
|
|
111
115
|
.compact/.spacious (variants.css) switch geometry (--control-size,
|
|
@@ -218,7 +218,8 @@
|
|
|
218
218
|
border: 0;
|
|
219
219
|
border-radius: inherit;
|
|
220
220
|
background: var(--text-subtle);
|
|
221
|
-
transform:
|
|
221
|
+
/* No transform here: the card's scale(0) keeps the dot hidden beside a
|
|
222
|
+
visible native input until the :has() block above reveals it. */
|
|
222
223
|
clip-path: circle(0.1875em at var(--choice-chip-dot));
|
|
223
224
|
z-index: -1;
|
|
224
225
|
transition: clip-path var(--duration);
|
package/src/css/forms/otp.css
CHANGED
|
@@ -71,6 +71,11 @@
|
|
|
71
71
|
font-family: var(--font-mono);
|
|
72
72
|
font-size: var(--otp-font-size);
|
|
73
73
|
font-variant-numeric: tabular-nums;
|
|
74
|
+
/* why: one glyph per cell. A code font (JetBrains Mono, Fira Code) joins
|
|
75
|
+
`+++` or `->` through ligatures and contextual alternates; Chromium drops
|
|
76
|
+
them under letter-spacing, Safari keeps them and the glyphs leave their
|
|
77
|
+
cells. */
|
|
78
|
+
font-variant-ligatures: none;
|
|
74
79
|
line-height: var(--otp-cell-size);
|
|
75
80
|
letter-spacing: calc(var(--otp-cell-size) + var(--otp-gap) - 1ch);
|
|
76
81
|
text-align: start;
|
package/src/css/forms/range.css
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* are not reliably applied across browsers.
|
|
10
10
|
*
|
|
11
11
|
* Public hooks:
|
|
12
|
-
* --range-thumb-size
|
|
12
|
+
* --range-thumb-size (the thumb's block size, and the control's)
|
|
13
|
+
* --range-thumb-inline-size
|
|
14
|
+
* --range-thumb-radius
|
|
13
15
|
* --range-track-height
|
|
14
16
|
* --range-thumb-bg
|
|
15
17
|
* --range-track-bg
|
|
@@ -27,6 +29,10 @@
|
|
|
27
29
|
|
|
28
30
|
.range {
|
|
29
31
|
--range-thumb-size: 1.125rem;
|
|
32
|
+
/* The thumb's shape, on vendor pseudo-elements a theme cannot reach in one
|
|
33
|
+
rule. The focus ring is a box-shadow, so it follows both. */
|
|
34
|
+
--range-thumb-inline-size: var(--range-thumb-size);
|
|
35
|
+
--range-thumb-radius: var(--radius-full);
|
|
30
36
|
--range-track-height: 0.625rem;
|
|
31
37
|
--range-thumb-bg: var(--intent, var(--primary));
|
|
32
38
|
--range-track-bg: var(--border);
|
|
@@ -84,9 +90,9 @@
|
|
|
84
90
|
.range::-webkit-slider-thumb {
|
|
85
91
|
appearance: none;
|
|
86
92
|
-webkit-appearance: none;
|
|
87
|
-
inline-size: var(--range-thumb-size);
|
|
93
|
+
inline-size: var(--range-thumb-inline-size);
|
|
88
94
|
block-size: var(--range-thumb-size);
|
|
89
|
-
border-radius: var(--radius
|
|
95
|
+
border-radius: var(--range-thumb-radius);
|
|
90
96
|
border: 0;
|
|
91
97
|
background: var(--range-thumb-bg);
|
|
92
98
|
margin-block-start: calc((var(--range-track-height) - var(--range-thumb-size)) / 2);
|
|
@@ -99,9 +105,9 @@
|
|
|
99
105
|
}
|
|
100
106
|
|
|
101
107
|
.range::-moz-range-thumb {
|
|
102
|
-
inline-size: var(--range-thumb-size);
|
|
108
|
+
inline-size: var(--range-thumb-inline-size);
|
|
103
109
|
block-size: var(--range-thumb-size);
|
|
104
|
-
border-radius: var(--radius
|
|
110
|
+
border-radius: var(--range-thumb-radius);
|
|
105
111
|
border: 0;
|
|
106
112
|
background: var(--range-thumb-bg);
|
|
107
113
|
cursor: inherit;
|
package/src/css/forms/select.css
CHANGED
package/src/js/dialog.js
CHANGED
|
@@ -359,6 +359,7 @@ function showDialog(dialog, focusReturn, forcedModal) {
|
|
|
359
359
|
const viewport = dialog.ownerDocument.defaultView;
|
|
360
360
|
const scrollX = viewport?.scrollX ?? 0;
|
|
361
361
|
const scrollY = viewport?.scrollY ?? 0;
|
|
362
|
+
const indicated = dialog.ownerDocument.activeElement?.matches(":focus-visible") === true;
|
|
362
363
|
|
|
363
364
|
if (modal) {
|
|
364
365
|
dialog.showModal();
|
|
@@ -367,6 +368,7 @@ function showDialog(dialog, focusReturn, forcedModal) {
|
|
|
367
368
|
dialog.show();
|
|
368
369
|
state.modalOpen = false;
|
|
369
370
|
}
|
|
371
|
+
if (!indicated) quietInitialFocus(dialog);
|
|
370
372
|
|
|
371
373
|
if (scrollX !== 0 || scrollY > 0) {
|
|
372
374
|
viewport?.scrollTo(scrollX, scrollY);
|
|
@@ -375,6 +377,23 @@ function showDialog(dialog, focusReturn, forcedModal) {
|
|
|
375
377
|
syncModalOpenClass(dialog.ownerDocument);
|
|
376
378
|
}
|
|
377
379
|
|
|
380
|
+
/*
|
|
381
|
+
* WebKit shows the focus ring on the control showModal() focuses even when a
|
|
382
|
+
* tap or a click opened the dialog, so a Cancel button looked pressed on an
|
|
383
|
+
* iPad. Chromium and Firefox follow the opening's modality: the ring shows
|
|
384
|
+
* only when the element focused before it showed one. Refocusing with
|
|
385
|
+
* focusVisible: false brings WebKit in line; it needs the blur, since focusing
|
|
386
|
+
* the active element again is a no-op. Text fields keep their ring in every
|
|
387
|
+
* engine, whatever the modality.
|
|
388
|
+
*/
|
|
389
|
+
function quietInitialFocus(dialog) {
|
|
390
|
+
const focused = dialog.ownerDocument.activeElement;
|
|
391
|
+
if (!focused || !dialog.contains(focused) || !focused.matches(":focus-visible")) return;
|
|
392
|
+
if (focused.matches("input, textarea, select, [contenteditable]")) return;
|
|
393
|
+
focused.blur();
|
|
394
|
+
focused.focus({ focusVisible: false, preventScroll: true });
|
|
395
|
+
}
|
|
396
|
+
|
|
378
397
|
function handleDialogPointerDown(event) {
|
|
379
398
|
const dialog = event.currentTarget;
|
|
380
399
|
const state = dialogMap.get(dialog);
|