actual-css 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/actual.full.css +17 -1
- package/dist/actual.full.min.css +1 -1
- package/docs/design-notes/architecture.md +3 -0
- package/docs/design-notes/enhancement-contract.md +14 -0
- package/docs/design-notes/naming.md +6 -0
- package/docs/design-notes/steps.md +13 -2
- package/docs/design-notes/tokens.md +159 -0
- package/docs/pages/components/button.md +27 -7
- package/docs/pages/components/card.md +6 -7
- package/docs/pages/components/steps.md +30 -16
- package/docs/pages/enhancements/overview.md +13 -20
- package/docs/pages/enhancements/status-bar.md +7 -9
- package/docs/pages/enhancements/tabs.md +11 -15
- package/docs/pages/enhancements/tooltip.md +10 -19
- package/docs/pages/forms/joined-controls.md +4 -2
- package/docs/pages/foundations/philosophy.md +26 -62
- package/docs/pages/foundations/theming.md +21 -36
- package/docs/pages/foundations/tokens.md +91 -159
- package/docs/pages/guides/integrating-actual-css.md +1 -1
- package/docs/pages/guides/introduction.md +13 -13
- package/docs/pages/layout/choosing.md +10 -16
- package/docs/pages/layout/grid.md +8 -16
- package/docs/pages/patterns/intent-nesting.md +13 -1
- package/package.json +1 -1
- package/src/css/components/app-nav.css +2 -0
- package/src/css/core/base.css +10 -1
- package/src/css/core/reset.css +5 -0
|
@@ -43,6 +43,9 @@ padding and type together has become a component, whatever file it lives in.
|
|
|
43
43
|
|
|
44
44
|
## Tokens
|
|
45
45
|
|
|
46
|
+
See [Token architecture](tokens.md) for scope, inheritance, size and density,
|
|
47
|
+
color interpolation, motion, and component mapping constraints.
|
|
48
|
+
|
|
46
49
|
A value derived from an overridable token is computed on the element that uses
|
|
47
50
|
it, never as an alias on `:root`: an inherited custom property arrives already
|
|
48
51
|
computed, so an override on a theme island or a region would not reach it. The
|
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
Actual CSS splits CSS and JavaScript into two independent layers with a shared
|
|
4
4
|
opt-in mechanism. Every component uses the same grammar.
|
|
5
5
|
|
|
6
|
+
## Popover ownership
|
|
7
|
+
|
|
8
|
+
The runtime owns `popover="manual"` and native show/hide calls on managed
|
|
9
|
+
surfaces and tooltips. Native automatic dismissal would compete with Actual's
|
|
10
|
+
close policy. Canceling `beforetoggle` would leave the runtime's open state
|
|
11
|
+
out of sync with platform visibility, so applications cancel
|
|
12
|
+
`actual:surface-open` before promotion instead.
|
|
13
|
+
|
|
14
|
+
Explicit tooltips stay in place to preserve inherited context. Generated
|
|
15
|
+
tooltips are mounted outside the trigger's sibling sequence: inserting one
|
|
16
|
+
beside the trigger would change structural selectors such as
|
|
17
|
+
`.join > :last-child`. Generated tooltips therefore make no promise to inherit
|
|
18
|
+
the trigger's theme or density.
|
|
19
|
+
|
|
6
20
|
## The four-layer contract
|
|
7
21
|
|
|
8
22
|
```text
|
|
@@ -27,6 +27,12 @@ Actual CSS is intended for new projects. Existing projects with class collisions
|
|
|
27
27
|
|
|
28
28
|
### Rules
|
|
29
29
|
|
|
30
|
+
Modifiers use separate classes because intents, treatments, and sizes are
|
|
31
|
+
shared across components. A custom `.tertiary` intent can then work on buttons,
|
|
32
|
+
badges, and alerts without a modifier for each block. Native and ARIA attributes
|
|
33
|
+
carry state without a parallel class to synchronize. Semantic children such as
|
|
34
|
+
a card's `header` and `footer` need no extra element class.
|
|
35
|
+
|
|
30
36
|
- Classes name components, not markup. Prefer the established UI term even when it matches the element (`.select`, `.table`); do not invent synonyms just to avoid repetition.
|
|
31
37
|
- When one element can host multiple components, use the component role instead of the element name (`.modal` / `.drawer` on `dialog`, `.check` / `.radio` / `.switch` on `input`).
|
|
32
38
|
- Do not merely restate the element when a more precise or canonical component name exists (`.key`, not `.kbd`; `.modal` / `.drawer`, not `.dialog`).
|
|
@@ -169,10 +169,21 @@ It is not behind a viewport query. Edge alignment is the row's geometry, the
|
|
|
169
169
|
one the compact and inline forms already have, and a breakpoint on the viewport
|
|
170
170
|
would lay out the same 600px row differently on a phone and in a desktop card.
|
|
171
171
|
|
|
172
|
+
The end labels pay for that alignment: each gets half a share, and that is
|
|
173
|
+
already all the room it can have. Two neighbouring labels meet at the midpoint
|
|
174
|
+
between their markers, and an end label already runs from the row's edge to
|
|
175
|
+
that midpoint, so widening it would let it overlap a long neighbour. Giving the
|
|
176
|
+
end labels a full share means centring them under inset markers, which gives
|
|
177
|
+
up the edge alignment. That is a design trade, not a technical limit, and it
|
|
178
|
+
stays open to re-evaluation if narrow rows need longer end names.
|
|
179
|
+
|
|
172
180
|
The marker sets the default item floor. A `minmax(0, 1fr)` grid column keeps a
|
|
173
181
|
long label from widening its step; `hyphens: auto` breaks a long word where the
|
|
174
|
-
page's `lang
|
|
175
|
-
fit when it does not.
|
|
182
|
+
browser has a dictionary for the page's `lang`, and `overflow-wrap: anywhere`
|
|
183
|
+
still lets an unbroken name fit when it does not. Automatic hyphenation is not
|
|
184
|
+
a contract: headless Chrome hyphenates `account` but breaks `Account` as
|
|
185
|
+
`Accoun`/`t`, and most labels are capitalised. An authored `­` is the
|
|
186
|
+
predictable break. `--step-gap` separates both the marker from its label and
|
|
176
187
|
one step from the next, so wrapped names cannot run together.
|
|
177
188
|
|
|
178
189
|
Authors can raise `--step-min` when wrapping costs too much height. The row
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Token architecture
|
|
2
|
+
|
|
3
|
+
User-facing hooks and theming guidance are in
|
|
4
|
+
[Tokens](../pages/foundations/tokens.md). This note records implementation
|
|
5
|
+
constraints and the reasoning behind the token system.
|
|
6
|
+
|
|
7
|
+
## Scope and inheritance
|
|
8
|
+
|
|
9
|
+
Custom properties resolve their references on the element that declares them.
|
|
10
|
+
An alias declared only on `:root` arrives in a theme island already resolved,
|
|
11
|
+
so it cannot follow the island's palette. Theme-derived aliases must be
|
|
12
|
+
redeclared on `:root, [data-theme]`.
|
|
13
|
+
|
|
14
|
+
Optional hooks such as `--state-selected-text` reset to the guaranteed-invalid
|
|
15
|
+
value at each theme boundary. Consumers then fall back to that theme's
|
|
16
|
+
`--state-selected`, rather than inheriting an outer theme's resolved color.
|
|
17
|
+
|
|
18
|
+
Instance geometry resets on each instance; palette, rhythm, and policy inherit.
|
|
19
|
+
A reset is safe only when the instance itself consumes the hook. The children
|
|
20
|
+
of `.switcher` and `.sidebar-layout` consume their layout hooks, so those hooks
|
|
21
|
+
keep inheriting: a nested instance may also need its parent's value as a child.
|
|
22
|
+
|
|
23
|
+
## Intent boundaries
|
|
24
|
+
|
|
25
|
+
Intent classes expose `--intent`, `--intent-fg`, and `--intent-soft-fg`.
|
|
26
|
+
Each consuming component resets the relays it uses in a `:where()` rule.
|
|
27
|
+
This stops ancestor intents from tinting nested components while allowing a
|
|
28
|
+
local intent class to win by specificity. Both directions are covered by
|
|
29
|
+
`tests/css-audit.test.js`, `tests/browser/intent-boundary.test.js`, and
|
|
30
|
+
`tests/browser/soft-boundary.test.js`.
|
|
31
|
+
|
|
32
|
+
## Size and density
|
|
33
|
+
|
|
34
|
+
Size changes optical scale; density changes spacing and geometry independently
|
|
35
|
+
of text and icons. Components participate only where that distinction is
|
|
36
|
+
meaningful. Controls change geometry and rhythm, content rows change rhythm,
|
|
37
|
+
and badges, avatars, and other intrinsically sized components keep their own
|
|
38
|
+
size scale. Explicit local size wins over inherited density where they overlap.
|
|
39
|
+
|
|
40
|
+
## Palette
|
|
41
|
+
|
|
42
|
+
A coherent palette treats surfaces, text, borders, intents, and shadows as related roles rather than isolated colors.
|
|
43
|
+
|
|
44
|
+
Coherence does not mean that every token must be chromatic. Pure or near-pure whites and blacks remain legitimate where their role calls for them; what matters is that the surrounding neutral ramp and derived treatments belong to the same visual family.
|
|
45
|
+
|
|
46
|
+
Neutral roles may lean toward the palette's ambient hue — by default the primary's — while lightness and chroma stay curated per role. Chroma runs strongest through the ramp's mid-lightness rungs, often around `--border` and `--text-muted` depending on the color scheme, and tapers toward both ends. A palette whose accent is deliberately warmer or cooler than its paper picks an ambient hue of its own.
|
|
47
|
+
|
|
48
|
+
Semantic intents are curated colors, not mechanical derivatives of `--primary`. Danger, warning, and success stay recognizable for their function, but they are chosen as members of the theme palette rather than copied independently from a generic scale. Neither intents nor neutrals are derived from `--primary` at runtime: the relationship is a design decision recorded in the theme's own values.
|
|
49
|
+
|
|
50
|
+
Color should reinforce structure and meaning, not carry them alone. Information hierarchy and semantic states should remain understandable when hue is removed or unavailable. Desaturating a composition is a useful review heuristic, not a conformance test.
|
|
51
|
+
|
|
52
|
+
## Soft foreground calibration
|
|
53
|
+
|
|
54
|
+
Calibrate soft text against the closest resting and hovered surfaces, not just
|
|
55
|
+
against the page. Translucent tints change with the surface underneath, and
|
|
56
|
+
hover adds intent through `--soft-hover-alpha`. The default theme's per-role
|
|
57
|
+
foregrounds hold 4.5:1 on `--surface`, `--surface-raised`, and `--surface-subtle`
|
|
58
|
+
in both schemes; `tests/browser/soft-recipe.test.js` enforces that contract.
|
|
59
|
+
Named themes reset these hooks to avoid inheriting colors calibrated for the
|
|
60
|
+
default palette. Their global mix or per-role hooks need separate measurement.
|
|
61
|
+
|
|
62
|
+
## Contextual color interpolation
|
|
63
|
+
|
|
64
|
+
**When an intent is tinted against a theme-controlled surface or border, the mix interpolates in `oklab`.** That covers the soft recipe, the checked `.choice-card` tint, and the `.overline.pill` border.
|
|
65
|
+
|
|
66
|
+
Not because rectangular interpolation is more faithful to the intent hue — across the shipped presets it is a few degrees *less* faithful. A browser treats hue as powerless below a small chroma epsilon, so for the low-chroma surfaces and borders the presets actually use, a polar mix snaps cleanly onto the intent and wins.
|
|
67
|
+
|
|
68
|
+
The reason is continuity. A theme owns `--surface` and `--border`, and may put them anywhere from achromatic to vivid. Under polar interpolation that range contains a cliff: below the epsilon the mix tracks the intent, above it the surface hue starts winning, and crossing it moves the result into a different color family — 116 degrees, a soft `.secondary` landing in the greens. Cartesian interpolation responds smoothly across the whole range a public token allows. A recipe that is only correct while an adopter's surface stays under an unstated, implementation-defined threshold is not a contract, so the framework trades a small continuous error for a predictable one. The present cost is imperceptible: the largest difference the rule introduces in any preset is 3/255 on one channel.
|
|
69
|
+
|
|
70
|
+
Mixing against `black`, `white`, `transparent`, or `currentColor` is exempt and stays in `oklch`: those have no hue to interpolate, so both spaces give byte-identical results. Polar interpolation also stays legitimate where hue rotation is the point, such as sweeping a gradient through hues. `bun run check:color-space` enforces the rule for contextual tints and takes an `intentional-oklch` comment as an escape hatch.
|
|
71
|
+
|
|
72
|
+
## Motion
|
|
73
|
+
|
|
74
|
+
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`.
|
|
75
|
+
|
|
76
|
+
## Internal tokens
|
|
77
|
+
|
|
78
|
+
Internal tokens are allowed when they reduce duplication or make component code clearer.
|
|
79
|
+
|
|
80
|
+
### Variant plumbing
|
|
81
|
+
|
|
82
|
+
The shared visual variants are:
|
|
83
|
+
|
|
84
|
+
- `.solid`: full background, paired foreground. This is the default for buttons.
|
|
85
|
+
- `.soft`: lightly tinted background, colored text. Good for alerts, badges, and secondary actions.
|
|
86
|
+
- `.outline`: transparent background, colored border and text.
|
|
87
|
+
- `.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.
|
|
88
|
+
|
|
89
|
+
Buttons also support two button-only variants:
|
|
90
|
+
|
|
91
|
+
- `.ghost`: transparent button with hover affordance.
|
|
92
|
+
- `.link`: button semantics with link presentation.
|
|
93
|
+
|
|
94
|
+
Do not force `.ghost` or `.link` onto components where the interaction model does not fit. Shared API should follow shared use.
|
|
95
|
+
|
|
96
|
+
Components map global tokens to local aliases once at the top of the component and consume local tokens afterwards:
|
|
97
|
+
|
|
98
|
+
```css
|
|
99
|
+
.btn {
|
|
100
|
+
--btn-bg: var(--ui-bg, var(--btn-default-bg, var(--intent, var(--neutral))));
|
|
101
|
+
--btn-fg: var(--ui-fg, var(--btn-default-fg, var(--intent-fg, var(--neutral-fg))));
|
|
102
|
+
--btn-border: var(--ui-border, var(--btn-default-border, transparent));
|
|
103
|
+
|
|
104
|
+
border: var(--border-width) solid var(--btn-border-color, var(--btn-border));
|
|
105
|
+
border-block-end-color: var(
|
|
106
|
+
--btn-border-block-end-color,
|
|
107
|
+
var(--btn-border-color, var(--btn-border))
|
|
108
|
+
);
|
|
109
|
+
border-block-end-width: var(--btn-border-block-end-width, var(--border-width));
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The `--btn-*` fallbacks are intentionally inherited extension points for themes that change button grammar — such as turning the default solid button into a surface button with an intent-colored lower edge (the `edge` theme does exactly this). Keep them local until the same need appears across multiple components.
|
|
114
|
+
|
|
115
|
+
Text controls (`.input`/`.textarea`/`.select`) expose the same lower-edge extension point: `--control-border-block-end-color` and `--control-border-block-end-width` are unset by default and fall back to the regular border, so a theme can give inputs an underline-style lower edge the same way, without fighting the hover/focus/disabled state rules that still own `--control-border` itself.
|
|
116
|
+
|
|
117
|
+
Alerts expose the same idea on the leading edge instead of the lower one: `--alert-border-inline-start-color` and `--alert-border-inline-start-width` are unset by default and fall back to the regular `--ui-border`, so a theme can turn an alert into a callout with a colored flag on the inline-start side, matching the classic notice pattern, without a per-variant override.
|
|
118
|
+
|
|
119
|
+
A theme is not limited to the tokens above; it can restate any component-local token or rule under a state selector to change the interaction recipe itself, not just the palette. The `gradient` theme does this for field focus: it restores a `--focus` border plus an outer translucent halo in place of the core inset outline.
|
|
120
|
+
|
|
121
|
+
Rules:
|
|
122
|
+
|
|
123
|
+
- Prefix internal component tokens with the component name (`--btn-*`, `--alert-*`, `--card-*`).
|
|
124
|
+
- Prefix shared variant plumbing with `--ui-*`.
|
|
125
|
+
- The shared relays `--ui-*`, `--intent*`, and `--density-*` are framework plumbing: they are classified once at framework level, not restated in every component file.
|
|
126
|
+
- Keep component-specific variants in component code when they do not generalize.
|
|
127
|
+
- `flush` is a shared modifier: it removes the component's outer chrome so the component sits directly inside an existing surface (`.accordion.flush`). Reuse the term one component at a time when the same integration need appears elsewhere; `separated` stays component-local until a second real consumer exists.
|
|
128
|
+
- Do not require users to override internal tokens for ordinary theming.
|
|
129
|
+
- Promote an internal token to public only when there is a repeated, reasonable customization need.
|
|
130
|
+
- A custom property used only in a fallback position (`var(--x, default)`) and never declared is an unset extension point and must carry a classification — public, framework plumbing, or internal. `check:css-api` fails on any unclassified fallback-only property; it does not force an artificial declaration to satisfy the audit.
|
|
131
|
+
|
|
132
|
+
## Component mapping
|
|
133
|
+
|
|
134
|
+
Components map global tokens to local aliases at the top of the component, then use the local tokens afterwards. This makes the contract obvious:
|
|
135
|
+
|
|
136
|
+
```css
|
|
137
|
+
.alert {
|
|
138
|
+
--alert-bg: var(--ui-bg, var(--surface-subtle));
|
|
139
|
+
--alert-fg: var(--ui-fg, var(--intent, var(--text)));
|
|
140
|
+
--alert-border: var(--ui-border, var(--border));
|
|
141
|
+
|
|
142
|
+
border: var(--border-width) solid var(--alert-border);
|
|
143
|
+
border-radius: var(--alert-radius, var(--radius-lg));
|
|
144
|
+
background: var(--alert-bg);
|
|
145
|
+
color: var(--alert-fg);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
- theme authors adjust global tokens
|
|
150
|
+
- variant code adjusts `--ui-*`
|
|
151
|
+
- component code consumes local aliases
|
|
152
|
+
|
|
153
|
+
## Non-goals
|
|
154
|
+
|
|
155
|
+
- Do not expose a separate token for every selector.
|
|
156
|
+
- Do not mirror Pico-style component-specific variables unless there is a clear need.
|
|
157
|
+
- Do not add Tailwind-like color scales as public API.
|
|
158
|
+
- Do not rely on Sass, PostCSS, or generated token files.
|
|
159
|
+
- Do not make dark mode required for old browsers. Light mode is the fallback.
|
|
@@ -149,13 +149,10 @@ and collapses the shared edges.
|
|
|
149
149
|
</div>
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
only to carry meaning: [Toggle](#toggle) marks a pressed button with a solid
|
|
157
|
-
fill among outlines. For one choice among a few on a shared track, use a
|
|
158
|
-
[segmented control](segmented.md) instead.
|
|
152
|
+
Use the same variant across a group. Change a button's variant to mark a
|
|
153
|
+
meaningful state, such as a solid pressed [toggle](#toggle) among outlines.
|
|
154
|
+
For one choice among a few on a shared track, use a
|
|
155
|
+
[segmented control](segmented.md).
|
|
159
156
|
|
|
160
157
|
## Sizes
|
|
161
158
|
|
|
@@ -266,6 +263,29 @@ For exclusive groups, manage a single pressed button:
|
|
|
266
263
|
</script>
|
|
267
264
|
```
|
|
268
265
|
|
|
266
|
+
### Touch feedback
|
|
267
|
+
|
|
268
|
+
The reset sets `-webkit-tap-highlight-color: transparent` on `html`: the native
|
|
269
|
+
tap flash is a rectangle that ignores `--btn-radius`. A pressed button moves
|
|
270
|
+
down a pixel instead. A bare text link (`<a href>` with no class) has no
|
|
271
|
+
pressed state of its own, so it keeps a flash tinted from its own color. The
|
|
272
|
+
property inherits, so one declaration on a container restores the native flash
|
|
273
|
+
on its components. Tap both rows on a phone to compare:
|
|
274
|
+
|
|
275
|
+
```html demo
|
|
276
|
+
<div class="stack">
|
|
277
|
+
<div class="cluster">
|
|
278
|
+
<button class="btn primary" type="button" style="--btn-radius: var(--radius-full);">Default</button>
|
|
279
|
+
<label class="choice-card chip"><input type="checkbox" /> Chip</label>
|
|
280
|
+
<a href="#touch-feedback">Text link</a>
|
|
281
|
+
</div>
|
|
282
|
+
<div class="cluster" style="-webkit-tap-highlight-color: rgb(0 0 0 / 0.2);">
|
|
283
|
+
<button class="btn primary" type="button" style="--btn-radius: var(--radius-full);">Native flash</button>
|
|
284
|
+
<label class="choice-card chip"><input type="checkbox" /> Chip</label>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
```
|
|
288
|
+
|
|
269
289
|
## Accessibility
|
|
270
290
|
|
|
271
291
|
- Always set `type="button"` when a button is not submitting a form.
|
|
@@ -26,13 +26,12 @@ Nested cards and `data-theme` islands establish their own link context.
|
|
|
26
26
|
## Basic usage
|
|
27
27
|
|
|
28
28
|
Use semantic elements inside the card. A direct `<header>` or `<footer>` is the
|
|
29
|
-
card's
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
primitives
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
gap.
|
|
29
|
+
card's header or footer slot. When the card has spare height, its footer stays
|
|
30
|
+
at the bottom, aligning prices and actions across equal-height cards.
|
|
31
|
+
|
|
32
|
+
Use layout primitives such as `.grid` to space cards. Within a bare card,
|
|
33
|
+
`--card-gap` spaces the direct children. Add `.stack` or `.media` to the card
|
|
34
|
+
to let that primitive control its layout and gap.
|
|
36
35
|
|
|
37
36
|
```html demo
|
|
38
37
|
<div style="max-inline-size: 32rem">
|
|
@@ -139,23 +139,37 @@ names, or when a step should be navigable:
|
|
|
139
139
|
|
|
140
140
|
```html demo
|
|
141
141
|
<ol class="steps steps-horizontal" aria-label="Checkout progress">
|
|
142
|
-
<li class="step-complete"><span class="step-label">
|
|
143
|
-
<li class="step-complete"><span class="step-label">
|
|
144
|
-
<li aria-current="step"><span class="step-label">
|
|
145
|
-
<li><span class="step-label">
|
|
142
|
+
<li class="step-complete"><span class="step-label">Cart</span></li>
|
|
143
|
+
<li class="step-complete"><span class="step-label">Details</span></li>
|
|
144
|
+
<li aria-current="step"><span class="step-label">Review</span></li>
|
|
145
|
+
<li><span class="step-label">Pay</span></li>
|
|
146
146
|
</ol>
|
|
147
147
|
```
|
|
148
148
|
|
|
149
149
|
**Actual CSS never hides an authored step label.** Labels stay visible at every
|
|
150
150
|
width. Stacked steps keep their markers evenly spaced, and long names wrap
|
|
151
|
-
inside their share
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
inside their share. The first and last steps align with the row's edges, labels
|
|
152
|
+
included, so the track lines up with the heading above it. Their labels get
|
|
153
|
+
half a share, so a phone-width row reads best with short names at both ends.
|
|
154
|
+
|
|
155
|
+
Automatic hyphenation depends on the browser, the language and its
|
|
156
|
+
dictionaries. Mark break points with `­` (`Ac­count`) when a long name
|
|
157
|
+
must wrap predictably.
|
|
154
158
|
|
|
155
159
|
Set `--step-min` when names need a wider minimum share. If the markers or that
|
|
156
160
|
minimum do not fit, the row scrolls; use `.steps-vertical` when every name must
|
|
157
161
|
remain visible without horizontal scrolling.
|
|
158
162
|
|
|
163
|
+
```html demo
|
|
164
|
+
<ol class="steps steps-horizontal scroller" style="--step-min: 7rem" aria-label="Order progress">
|
|
165
|
+
<li class="step-complete"><span class="step-label">Account</span></li>
|
|
166
|
+
<li class="step-complete"><span class="step-label">Shipping address</span></li>
|
|
167
|
+
<li aria-current="step"><span class="step-label">Payment method</span></li>
|
|
168
|
+
<li><span class="step-label">Review order</span></li>
|
|
169
|
+
<li><span class="step-label">Confirm</span></li>
|
|
170
|
+
</ol>
|
|
171
|
+
```
|
|
172
|
+
|
|
159
173
|
In supporting browsers, a row that scrolls starts on its `aria-current="step"`
|
|
160
174
|
instead of step 1. A row
|
|
161
175
|
that raises `--step-min` can scroll, so it is worth pairing with `.scroller`,
|
|
@@ -198,17 +212,17 @@ Resize the demo below. The 3-step flow needs less room than the supported
|
|
|
198
212
|
```html demo resize
|
|
199
213
|
<div class="stack">
|
|
200
214
|
<ol class="steps steps-horizontal container-query scroller" style="--step-complete-mark: '✓'">
|
|
201
|
-
<li class="step-complete"><span class="step-label">
|
|
202
|
-
<li aria-current="step"><span class="step-label">
|
|
203
|
-
<li><span class="step-label">
|
|
215
|
+
<li class="step-complete"><span class="step-label">Account</span></li>
|
|
216
|
+
<li aria-current="step"><span class="step-label">Payment</span></li>
|
|
217
|
+
<li><span class="step-label">Confirm</span></li>
|
|
204
218
|
</ol>
|
|
205
219
|
|
|
206
220
|
<ol class="steps steps-horizontal container-query scroller" style="--step-complete-mark: '✓'">
|
|
207
|
-
<li class="step-complete"><span class="step-label">
|
|
208
|
-
<li class="step-complete"><span class="step-label">
|
|
209
|
-
<li aria-current="step"><span class="step-label">
|
|
221
|
+
<li class="step-complete"><span class="step-label">Cart</span></li>
|
|
222
|
+
<li class="step-complete"><span class="step-label">Ship</span></li>
|
|
223
|
+
<li aria-current="step"><span class="step-label">Pay</span></li>
|
|
210
224
|
<li><span class="step-label">Review</span></li>
|
|
211
|
-
<li><span class="step-label">
|
|
225
|
+
<li><span class="step-label">Done</span></li>
|
|
212
226
|
</ol>
|
|
213
227
|
</div>
|
|
214
228
|
```
|
|
@@ -334,7 +348,7 @@ label a link when the workflow genuinely allows navigation to that step:
|
|
|
334
348
|
```html demo resize
|
|
335
349
|
<ol class="steps steps-horizontal container-query scroller">
|
|
336
350
|
<li class="step-complete">
|
|
337
|
-
<a class="step-label" href="#">
|
|
351
|
+
<a class="step-label" href="#">Cart</a>
|
|
338
352
|
</li>
|
|
339
353
|
<li class="step-complete">
|
|
340
354
|
<a class="step-label" href="#">Details</a>
|
|
@@ -343,7 +357,7 @@ label a link when the workflow genuinely allows navigation to that step:
|
|
|
343
357
|
<span class="step-label">Payment</span>
|
|
344
358
|
</li>
|
|
345
359
|
<li>
|
|
346
|
-
<span class="step-label">
|
|
360
|
+
<span class="step-label">Done</span>
|
|
347
361
|
</li>
|
|
348
362
|
</ol>
|
|
349
363
|
```
|
|
@@ -19,24 +19,19 @@ Actual drives the top layer itself. On every surface and tooltip its runtime
|
|
|
19
19
|
manages, `surface.js` and `tooltip.js` own the `popover` attribute and both
|
|
20
20
|
`showPopover()` and `hidePopover()`.
|
|
21
21
|
|
|
22
|
-
On a managed element,
|
|
22
|
+
On a managed element, leave `popover` and its native show/hide methods to the
|
|
23
|
+
runtime, and let `beforetoggle` proceed. To stop a surface from opening,
|
|
24
|
+
cancel `actual:surface-open`.
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
- call `showPopover()`, `hidePopover()`, or `togglePopover()`.
|
|
26
|
-
- cancel its `beforetoggle`. Preventing an open leaves Actual's state saying open while the element is not in the top layer, and nothing repairs that — Actual owns the lifecycle rather than mediating it.
|
|
26
|
+
The runtime manages elements connected to these triggers:
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
- `data-enhance="flyout"`, pointing to the panel through `aria-controls`.
|
|
29
|
+
- `data-context-menu`, naming the menu.
|
|
30
|
+
- `data-tooltip`, pointing to the tooltip.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
managed when a `data-tooltip` trigger points at it. A `.flyout[popover]` or
|
|
36
|
-
`.tooltip[popover]` that no such trigger reaches is never touched — Actual
|
|
37
|
-
supplies its presentation and the application owns its lifecycle. That is the
|
|
38
|
-
supported way to drive either class with `popovertarget` or a third-party
|
|
39
|
-
lifecycle. Do not do both to the same element.
|
|
32
|
+
You can drive an unconnected `.flyout[popover]` or `.tooltip[popover]` with
|
|
33
|
+
`popovertarget` or a third-party library. Actual supplies its appearance;
|
|
34
|
+
your code owns opening and dismissal. Use one owner per element.
|
|
40
35
|
|
|
41
36
|
## Modules
|
|
42
37
|
|
|
@@ -53,11 +48,9 @@ Enhancer modules self-register when imported. They do not require init calls and
|
|
|
53
48
|
are safe to import during server-side rendering: outside a browser, registration
|
|
54
49
|
is a no-op until the module is loaded again with a DOM.
|
|
55
50
|
|
|
56
|
-
Load the full bundle **or**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
behavior twice and a flyout opens then immediately closes. The second copy
|
|
60
|
-
logs a console warning when it loads.
|
|
51
|
+
Load the full bundle **or** individual source modules. Mixing them, or loading
|
|
52
|
+
two bundles, registers behaviors twice and can make a flyout close immediately
|
|
53
|
+
after opening. The runtime warns in the console when a second copy loads.
|
|
61
54
|
|
|
62
55
|
## Component pages
|
|
63
56
|
|
|
@@ -15,15 +15,13 @@ runtime targets, empty by default.
|
|
|
15
15
|
- Use it for transient status (`Saved.`, `Reconnected.`, `Copied.`). Critical, persistent, or actionable information belongs in `.alert`, inline messages, or dialogs.
|
|
16
16
|
- Intents: `danger`, `success`, `warning`, `neutral`. The default (no intent) is a neutral dark pill.
|
|
17
17
|
- On mobile, the runtime keeps the bar above the software keyboard by tracking `visualViewport` while a message is showing.
|
|
18
|
-
- A message
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
race. An empty message clears too, so `status(response.error)` on a successful
|
|
26
|
-
response closes the bar rather than opening a blank pill.
|
|
18
|
+
- A message from an open modal dialog temporarily moves the bar inside that
|
|
19
|
+
dialog so it remains visible and announced. The bar returns after its exit.
|
|
20
|
+
|
|
21
|
+
`clear()` closes the bar, then removes its text and intent after the exit
|
|
22
|
+
transition. The outgoing message remains readable in the DOM until then.
|
|
23
|
+
A new message replaces it safely, even during exit. Passing an empty message
|
|
24
|
+
also clears the bar.
|
|
27
25
|
|
|
28
26
|
The runtime auto-wires the status bar to Actual's form validation: a form that
|
|
29
27
|
fails to submit shows its `data-validation-message` in the status bar with the
|
|
@@ -27,10 +27,7 @@
|
|
|
27
27
|
- A tab list needs both `.tabs` and `role="tablist"`; `.tab` styles each trigger.
|
|
28
28
|
A tab belongs to its closest `role="tablist"`. `data-enhance="tabs"` on an
|
|
29
29
|
element without that role wires nothing and warns in the console.
|
|
30
|
-
-
|
|
31
|
-
`.tabs` is the strip, `.tab` is one trigger. The JS module
|
|
32
|
-
(`actual-css/js/tab`) is named for the file; the behavior token
|
|
33
|
-
(`data-enhance="tabs"`) is named for what it wires.
|
|
30
|
+
- Import `actual-css/js/tab` to register the `data-enhance="tabs"` behavior.
|
|
34
31
|
- A `.tab` with an icon uses `--tab-gap` (default `0.375em`) for the space between icon and label.
|
|
35
32
|
- A tab that is `hidden`, `disabled`, `aria-disabled`, or has no panel is skipped
|
|
36
33
|
by the arrow keys. An application filtering a tab strip only has to set
|
|
@@ -150,17 +147,16 @@ what fits on one row.
|
|
|
150
147
|
|
|
151
148
|
## Too many tabs
|
|
152
149
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
vertical strip (`aria-orientation="vertical"`) keeps wrapping its labels.
|
|
150
|
+
Horizontal tabs and their labels stay on one line. When they do not fit, the
|
|
151
|
+
strip scrolls without a scrollbar. Supporting browsers fade the edges to show
|
|
152
|
+
where more tabs remain. Selecting or focusing a clipped tab brings it into view.
|
|
153
|
+
|
|
154
|
+
A tab selected in the markup starts in view if the strip is visible when the
|
|
155
|
+
runtime connects. Only the strip scrolls; the page stays put. Current link tabs
|
|
156
|
+
and flyout triggers also start in view in supporting browsers, without the
|
|
157
|
+
runtime; other browsers start at the first tab.
|
|
158
|
+
|
|
159
|
+
Vertical tabs (`aria-orientation="vertical"`) allow their labels to wrap.
|
|
164
160
|
|
|
165
161
|
Scrolling is the fallback, not a responsive design. If a strip regularly
|
|
166
162
|
overflows, shorten the labels, group sections, or switch to a vertical rail.
|
|
@@ -28,25 +28,16 @@ positioning and with the projecting arrow, while leaving bare `[popover]`
|
|
|
28
28
|
elements untouched. The lifecycle owner still writes `position`, the
|
|
29
29
|
coordinates, and the arrow position; Actual only supplies the presentation.
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
custom properties. It also means placement is yours to get right: a tooltip
|
|
42
|
-
used from inside a modal dialog must be authored inside that dialog, because
|
|
43
|
-
the top layer does not lift an element out of a modal's inertness.
|
|
44
|
-
|
|
45
|
-
A generated tooltip (`data-tooltip="Help"`) is Actual's to place, and it goes
|
|
46
|
-
at document level rather than beside the trigger, so it cannot disturb the
|
|
47
|
-
trigger's structural position — a generated sibling would take
|
|
48
|
-
`.join > :last-child` from a trigger that ends a group. It therefore makes no
|
|
49
|
-
inheritance promise. Use the explicit form when the local CSS context matters.
|
|
31
|
+
Choose one lifecycle owner. Use `data-tooltip` when Actual should show and
|
|
32
|
+
hide the tooltip; the runtime sets `popover="manual"`. To manage a
|
|
33
|
+
`.tooltip[popover]` yourself, leave it unconnected to any `data-tooltip` trigger.
|
|
34
|
+
|
|
35
|
+
An explicit tooltip stays where you wrote it and inherits that location's
|
|
36
|
+
theme, density, and custom properties. Place it inside the dialog when its
|
|
37
|
+
trigger is in a modal dialog; content outside the modal is inert.
|
|
38
|
+
|
|
39
|
+
A generated tooltip (`data-tooltip="Help"`) does not inherit the trigger's
|
|
40
|
+
local CSS context. Use an explicit tooltip when that context matters.
|
|
50
41
|
|
|
51
42
|
```html demo
|
|
52
43
|
<button class="btn ghost"
|
|
@@ -17,9 +17,11 @@ choice among a few on a shared track, use a
|
|
|
17
17
|
|
|
18
18
|
Add `.join` to the wrapper that groups the controls. Use `.join-addon` for static prefix/suffix content such as currency symbols, units, or protocol text. Action buttons inside the group should use `.btn`. The wrapper should still carry `role="group"` with a label for accessibility.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Each child keeps its own variant. Use the same variant across the group, and
|
|
21
|
+
change it only to mark state, such as a solid pressed toggle among outlines.
|
|
21
22
|
|
|
22
|
-
When composing source files manually, import `components/join.css` after the
|
|
23
|
+
When composing source files manually, import `components/join.css` after the
|
|
24
|
+
controls it groups so joined corners take precedence.
|
|
23
25
|
|
|
24
26
|
```html demo
|
|
25
27
|
<div class="field">
|