actual-css 0.17.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +87 -0
- package/README.md +10 -6
- package/components.json +26 -6
- package/dist/actual.full.css +484 -76
- package/dist/actual.full.js +2 -2
- package/dist/actual.full.min.css +1 -1
- package/docs/design-notes/enhancement-contract.md +20 -11
- package/docs/design-notes/motion-cost.md +62 -0
- package/docs/design-notes/tokens.md +6 -1
- package/docs/navigation.json +4 -0
- package/docs/pages/components/alert.md +8 -6
- package/docs/pages/components/aura.md +3 -0
- package/docs/pages/components/button.md +26 -24
- package/docs/pages/components/list.md +117 -29
- package/docs/pages/components/mark-sweep.md +42 -0
- package/docs/pages/components/rating.md +53 -22
- package/docs/pages/components/reveal.md +54 -0
- package/docs/pages/components/shimmer.md +3 -2
- package/docs/pages/components/timeline.md +130 -2
- package/docs/pages/enhancements/in-view.md +109 -0
- package/docs/pages/enhancements/overview.md +3 -2
- package/docs/pages/enhancements/scrollspy.md +5 -5
- package/docs/pages/examples/overview.md +7 -2
- package/docs/pages/forms/date-picker.md +3 -2
- package/docs/pages/forms/switch.md +25 -16
- package/docs/pages/foundations/theming.md +6 -4
- package/docs/pages/foundations/tokens.md +39 -16
- package/docs/pages/foundations/typography.md +13 -2
- package/docs/pages/guides/coding-agents.md +163 -0
- package/docs/pages/guides/introduction.md +1 -1
- package/docs/pages/guides/modular-import.md +1 -1
- package/docs/pages/guides/progressive-enhancement.md +2 -1
- package/docs/pages/guides/upgrading.md +2 -2
- package/docs/pages/layout/scroll-snap.md +26 -1
- package/docs/pages/patterns/code-block.md +1 -1
- package/docs/pages/patterns/empty-state.md +3 -3
- package/docs/pages/patterns/exclusive-accordion.md +3 -2
- package/docs/pages/patterns/hierarchical-nav.md +5 -4
- package/docs/pages/patterns/icon-input.md +1 -1
- package/docs/pages/patterns/icon-slot.md +4 -4
- package/docs/pages/patterns/intent-nesting.md +2 -3
- package/docs/pages/patterns/navigation-list.md +7 -4
- package/docs/pages/patterns/stat.md +3 -3
- package/docs/pages/patterns/structured-lists.md +1 -2
- package/llms.txt +3 -2
- package/package.json +3 -1
- package/reserved-classes.json +6 -0
- package/skills/actual-css/PROJECT.md.example +13 -2
- package/skills/actual-css/README.md +5 -0
- package/skills/actual-css/SKILL.md +13 -2
- package/src/css/components/alert.css +40 -3
- package/src/css/components/button.css +20 -2
- package/src/css/components/join.css +3 -10
- package/src/css/components/list.css +32 -0
- package/src/css/components/navbar.css +13 -5
- package/src/css/components/rating.css +23 -2
- package/src/css/components/scrollspy.css +4 -2
- package/src/css/components/timeline.css +113 -10
- package/src/css/core/base.css +16 -0
- package/src/css/core/focus.css +13 -12
- package/src/css/core/reset.css +10 -0
- package/src/css/core/theme.css +15 -0
- package/src/css/core/tokens.css +8 -11
- package/src/css/effects/aura.css +5 -0
- package/src/css/effects/index.css +2 -0
- package/src/css/effects/mark-sweep.css +64 -0
- package/src/css/effects/reveal.css +66 -0
- package/src/css/effects/shimmer.css +28 -10
- package/src/css/forms/switch.css +9 -9
- package/src/js/full.js +1 -0
- package/src/js/in-view.js +152 -0
- package/src/js/scrollspy.js +81 -2
- package/src/js/selectors.js +3 -0
- package/src/tooling/design-components.js +2 -2
- package/src/tooling/design-tokens.js +2 -0
- package/tokens.json +2 -0
|
@@ -153,10 +153,12 @@ application CSS and keep forms and intent ink out of it:
|
|
|
153
153
|
}
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
Transparent
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
Transparent inks (`.btn.outline`, `.ghost`, `.link`) and headings follow that
|
|
157
|
+
ink; a neutral `.btn.outline` draws its border with `--border-control`, so the
|
|
158
|
+
edge stays visible without being derived from the band. Fields, their labels
|
|
159
|
+
and help text, and intent colors keep the page palette, which nothing tunes for
|
|
160
|
+
`--surface-solid`. Focus lines stay readable there: the theme contract keeps
|
|
161
|
+
`--focus` at 3:1 on `--surface-solid`.
|
|
160
162
|
|
|
161
163
|
→ Foundations · Tokens (theme contract) · Examples · Contrast contexts
|
|
162
164
|
|
|
@@ -128,23 +128,45 @@ A theme with translucent surfaces overrides both with opaque values.
|
|
|
128
128
|
|
|
129
129
|
`--border` separates surfaces: cards, tables, dividers, panels. `--border-control`
|
|
130
130
|
is the resting edge that tells a control apart from the surface — fields,
|
|
131
|
-
checkboxes and radios,
|
|
132
|
-
and file inputs. It is derived from `--text` and
|
|
133
|
-
palette it holds 3:1 against
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
131
|
+
checkboxes and radios, OTP cells, choice cards, join addons, neutral
|
|
132
|
+
outline buttons, the color and file inputs. It is derived from `--text` and
|
|
133
|
+
`--surface`; on the default palette it holds 3:1 against `--surface` and
|
|
134
|
+
2.9–3.0 against `--surface-subtle`. `actual-css contrast` reports it for your
|
|
135
|
+
theme. `--border-control-mix` sets the ink share; raise it when a tinted or
|
|
136
|
+
translucent surface pulls the edge under 3:1. The mix resolves at a theme
|
|
137
|
+
boundary: set it on `:root` or a `[data-theme]` island, because a plain container
|
|
138
|
+
inherits the colour already resolved above it. Without `color-mix()` it falls
|
|
139
|
+
back to `--border`. Set `--border-control` itself to soften or strengthen every
|
|
140
|
+
control in a subtree without touching a separator. Hover, checked, invalid and
|
|
141
|
+
disabled states keep their own colors.
|
|
142
|
+
|
|
143
|
+
```css
|
|
144
|
+
/* Every control in one theme: */
|
|
145
|
+
[data-theme="custom"] {
|
|
146
|
+
--border-control-mix: 35%;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Only the text fields of one form. --control-border is the control's own
|
|
150
|
+
alias, so it has to be set on the control, not on an ancestor. */
|
|
151
|
+
.my-form :is(.input, .textarea, .select) {
|
|
152
|
+
--control-border: var(--border);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Both reduce the contrast of the controls they touch; verify them in the context
|
|
157
|
+
they are used. The [border contrast lab](../../demo/templates/border-contrast.html)
|
|
158
|
+
renders the mix at 25, 35 and 45 % and measures both sides of the edge.
|
|
139
159
|
|
|
140
160
|
Use `*-fg` pairs only for solid backgrounds where the component controls both foreground and background. Do not require a foreground token for every surface token.
|
|
141
161
|
|
|
142
|
-
Focus uses an outline:
|
|
162
|
+
Focus uses an outline in `--focus`, independently of text color, intent or selection:
|
|
143
163
|
|
|
144
|
-
- Links, summaries, nav items, and menu items use
|
|
164
|
+
- Links, summaries, nav items, and menu items use the generic outside line.
|
|
145
165
|
- Text fields use `--focus` inside their border.
|
|
146
166
|
- Buttons, close controls, choices, and switches use `--focus` outside their border.
|
|
147
167
|
|
|
168
|
+
Invalid fields keep their validation color on the focus line.
|
|
169
|
+
|
|
148
170
|
`--focus-ring-width` controls all these lines; `--focus-outline-offset` sets
|
|
149
171
|
the outside gap. Choose `--focus` with at least 3:1 contrast against both
|
|
150
172
|
`--surface` and `--surface-solid`. Forced colors use the system focus color.
|
|
@@ -153,17 +175,18 @@ the outside gap. Choose `--focus` with at least 3:1 contrast against both
|
|
|
153
175
|
:root {
|
|
154
176
|
--focus: hsl(268 30% 55%);
|
|
155
177
|
|
|
156
|
-
--focus-outline-color: currentColor;
|
|
157
178
|
--focus-outline-offset: 2px;
|
|
158
179
|
--focus-ring-width: 2px;
|
|
159
180
|
}
|
|
160
181
|
```
|
|
161
182
|
|
|
162
|
-
The line is composed on the focused element, so
|
|
163
|
-
|
|
183
|
+
The line is composed on the focused element, so local `--focus` and
|
|
184
|
+
`--focus-ring-width` overrides reach links and buttons alike. Set
|
|
185
|
+
`--focus-outline-color` to override the generic line color; it has no default
|
|
186
|
+
declaration, and an author override inherits through theme islands. Set
|
|
164
187
|
`--focus-outline` to replace the whole generic line (`4px dashed currentColor`);
|
|
165
188
|
it has no default value. Application CSS that draws the generic line itself
|
|
166
|
-
writes `var(--focus-ring-width) solid var(--focus-outline-color)`.
|
|
189
|
+
writes `var(--focus-ring-width) solid var(--focus-outline-color, var(--focus))`.
|
|
167
190
|
|
|
168
191
|
### Palette coherence
|
|
169
192
|
|
|
@@ -294,7 +317,7 @@ Typography tokens cover the document baseline and common component needs.
|
|
|
294
317
|
|
|
295
318
|
```css
|
|
296
319
|
:root {
|
|
297
|
-
--font-sans: system-ui,
|
|
320
|
+
--font-sans: system-ui, sans-serif;
|
|
298
321
|
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
299
322
|
--font-width: 100%;
|
|
300
323
|
|
|
@@ -431,7 +454,7 @@ Motion durations keep transitions consistent and easy to disable.
|
|
|
431
454
|
--duration-fast: 100ms; /* quick feedback */
|
|
432
455
|
--duration-slow: 200ms; /* one-shot open/close */
|
|
433
456
|
--duration-spin: 0.75s; /* continuous spin (.spinner) */
|
|
434
|
-
--duration-shimmer:
|
|
457
|
+
--duration-shimmer: 2s; /* continuous shimmer (.shimmer, .skeleton, indeterminate .progress) */
|
|
435
458
|
--ease-enter: cubic-bezier(0.2, 0, 0, 1);
|
|
436
459
|
--ease-exit: cubic-bezier(0.4, 0, 1, 1);
|
|
437
460
|
}
|
|
@@ -38,7 +38,7 @@ It applies everywhere — cards, dialogs, heroes, app shells — not only in pro
|
|
|
38
38
|
|
|
39
39
|
It does not own visual hierarchy. No global `font-size` on headings, no global `font-weight` on headings, no global margins on headings, no global `text-decoration` on links. These choices would shape app UI in ways the framework cannot predict.
|
|
40
40
|
|
|
41
|
-
The mildly opinionated defaults at the baseline are few: line-height on headings (tight, so multi-line headings stay readable), `text-wrap: balance` on headings where supported, the `hr` rule, the `::selection` rule, the `code` / `kbd` / `samp` / `pre` font family, `pre` overflow containment, `small` font size, and a global link underline offset that prose and components reuse. Everything else stays neutral so components and `.prose` can take over without fighting the baseline.
|
|
41
|
+
The mildly opinionated defaults at the baseline are few: line-height on headings (tight, so multi-line headings stay readable), `text-wrap: balance` on headings where supported, the `hr` rule, the `::selection` rule, the `mark` highlight pair, the `code` / `kbd` / `samp` / `pre` font family, `pre` overflow containment, `small` font size, and a global link underline offset that prose and components reuse. Everything else stays neutral so components and `.prose` can take over without fighting the baseline.
|
|
42
42
|
|
|
43
43
|
Global links inherit color. The visual affordance of a link is the responsibility of `.prose` (for authored content) or of a component (for nav links, button-like links, tabs, breadcrumbs, etc.). Underlining every `a` globally would collide with all of those.
|
|
44
44
|
|
|
@@ -46,7 +46,7 @@ Global links inherit color. The visual affordance of a link is the responsibilit
|
|
|
46
46
|
|
|
47
47
|
`.prose` is the opt-in rich-text scope. It owns the visual hierarchy of authored content.
|
|
48
48
|
|
|
49
|
-
It owns: readable measure, vertical rhythm, heading hierarchy, link affordance, list spacing, description-list treatment, code and keyboard treatment, blockquote treatment, table treatment, image / figure / figcaption treatment,
|
|
49
|
+
It owns: readable measure, vertical rhythm, heading hierarchy, link affordance, list spacing, description-list treatment, code and keyboard treatment, blockquote treatment, table treatment, image / figure / figcaption treatment, and `text-wrap` balance / pretty for authored or generated rich-text descendants.
|
|
50
50
|
|
|
51
51
|
It does not own: page layout, app cards, alerts, forms, app tables, navigation, component variants, or any automatic styling outside the `.prose` subtree.
|
|
52
52
|
|
|
@@ -116,6 +116,11 @@ the document) and `--font-mono` (for `code` / `kbd` / `samp` / `pre`). There is
|
|
|
116
116
|
theme-level token in your own theme when a project actually needs one; the
|
|
117
117
|
baseline stays sans so app UI inherits predictably.
|
|
118
118
|
|
|
119
|
+
Both resolve to the platform's own faces, never a download, so two machines on
|
|
120
|
+
the same OS render alike and the package ships no font bytes. Override the slot
|
|
121
|
+
to opt into a webfont; this documentation site does it to load Inter for its own
|
|
122
|
+
pages.
|
|
123
|
+
|
|
119
124
|
### Font width
|
|
120
125
|
|
|
121
126
|
`--font-width` sets the document's `font-stretch`: a theme whose typeface has a
|
|
@@ -182,6 +187,12 @@ Three logical alignment utilities exist (`.text-start`, `.text-center`, `.text-e
|
|
|
182
187
|
|
|
183
188
|
`transition: all` is not used. Transitions target specific properties. This is a general rule, not just a typography rule.
|
|
184
189
|
|
|
190
|
+
## Mark
|
|
191
|
+
|
|
192
|
+
`mark` is styled at the baseline, not only inside `.prose`: a semantic highlight is a document affordance, and the UA's yellow ignores the theme. The pair is `--mark-bg` and `--mark-fg`, tuned to clear 4.5:1 in both schemes. Forced colors uses the system `Mark` / `MarkText` pair instead.
|
|
193
|
+
|
|
194
|
+
`<mark>` means the phrase is relevant in its context. A decorative highlight that only marks a phrase visually uses the [Mark Sweep](../components/mark-sweep.md) effect, which reuses the same pair.
|
|
195
|
+
|
|
185
196
|
## Small elements
|
|
186
197
|
|
|
187
198
|
`small` gets a smaller font size globally (`0.875em`) because it is a semantic element, not a utility. There is no `.small` class competing with the element.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Coding agents and DESIGN.md
|
|
2
|
+
|
|
3
|
+
Actual CSS ships a starter agent skill that teaches a coding agent the
|
|
4
|
+
framework's vocabulary: classes, hooks, layout primitives and enhancements. It
|
|
5
|
+
does not give your product a look. That comes from your theme and from a
|
|
6
|
+
`DESIGN.md` you write, alone or with a design skill such as
|
|
7
|
+
[Impeccable](https://impeccable.style/).
|
|
8
|
+
|
|
9
|
+
## Install the skill
|
|
10
|
+
|
|
11
|
+
The skill ships in the package under `skills/actual-css/`. Copy that directory
|
|
12
|
+
into the folder your agent loads skills from (`.claude/skills/actual-css/`,
|
|
13
|
+
for example), then copy `PROJECT.md.example` to `PROJECT.md` beside it.
|
|
14
|
+
|
|
15
|
+
The skill reads `components.json`, `tokens.json` and the sources from the
|
|
16
|
+
installed package, so it follows the version your project uses. See the
|
|
17
|
+
[skill source](https://github.com/lekoala/actual-css/tree/master/skills/actual-css).
|
|
18
|
+
|
|
19
|
+
## One fact, one file
|
|
20
|
+
|
|
21
|
+
| File | Owns | Location |
|
|
22
|
+
| ---------------- | ------------------------------------ | ---------------- |
|
|
23
|
+
| `PRODUCT.md` | audience, purpose, brand commitments | project root |
|
|
24
|
+
| `DESIGN.md` | visual direction and its rules | project root |
|
|
25
|
+
| Theme stylesheet | every value: colors, radii, shadows | your CSS |
|
|
26
|
+
| `PROJECT.md` | how the app uses Actual CSS | beside the skill |
|
|
27
|
+
| Actual CSS | vocabulary, components, behavior | the package |
|
|
28
|
+
|
|
29
|
+
`DESIGN.md` records the approved visual direction; the theme defines the values
|
|
30
|
+
actually shipped; `PROJECT.md` says with which classes. When `DESIGN.md` and
|
|
31
|
+
the theme disagree, neither wins by default: decide whether the design changed
|
|
32
|
+
on purpose or the code drifted, then update the stale document or fix the
|
|
33
|
+
theme. Confirm what the user sees on the rendered page.
|
|
34
|
+
|
|
35
|
+
## What goes in DESIGN.md
|
|
36
|
+
|
|
37
|
+
`DESIGN.md` follows the
|
|
38
|
+
[DESIGN.md format](https://github.com/google-labs-code/design.md): optional
|
|
39
|
+
YAML tokens, then prose sections. Use the eight canonical headings, in this
|
|
40
|
+
order: Overview, Colors, Typography, Layout, Elevation & Depth, Shapes,
|
|
41
|
+
Components, Do's and Don'ts. Other headings are preserved, but tools such as
|
|
42
|
+
Impeccable read these ones; leave out the sections you have nothing to say in.
|
|
43
|
+
|
|
44
|
+
Write the decisions the code cannot show:
|
|
45
|
+
|
|
46
|
+
- the mood and what to avoid ("calm and precise, not a generic admin
|
|
47
|
+
dashboard");
|
|
48
|
+
- what each color is reserved for ("the primary color marks the one key action
|
|
49
|
+
of a region");
|
|
50
|
+
- depth and density ("flat at rest", "dense tables, generous forms");
|
|
51
|
+
- named rules an agent can cite ("The Quiet Ground Rule: state shows as a soft
|
|
52
|
+
tint, never a strong fill").
|
|
53
|
+
|
|
54
|
+
Leave out of the prose:
|
|
55
|
+
|
|
56
|
+
- **Values.** Name the token in parentheses (`--primary`); the value belongs
|
|
57
|
+
in the YAML tokens.
|
|
58
|
+
- **Class names.** Describe the role; the class mapping is in `PROJECT.md`.
|
|
59
|
+
- **What Actual CSS already guarantees**: visible focus, reduced motion,
|
|
60
|
+
forced colors. Record a product's own decision on focus, states or motion;
|
|
61
|
+
do not restate the default.
|
|
62
|
+
|
|
63
|
+
The YAML tokens are the structured layer of the format: tools validate them
|
|
64
|
+
and measure drift against them. A first direction can do without; an
|
|
65
|
+
established visual system should carry them. Put them in the frontmatter,
|
|
66
|
+
where Impeccable reads them, keyed by the Actual token name without `--`, as
|
|
67
|
+
the [design tool export](design-tools.md) does. Keep them in sync with the
|
|
68
|
+
theme: `/impeccable document` refreshes them from the code once a change is
|
|
69
|
+
approved.
|
|
70
|
+
|
|
71
|
+
A DESIGN.md taken from another site is a reference, not yours: keep it outside
|
|
72
|
+
the project root (`design/references/`), so agents do not adopt its brand as
|
|
73
|
+
your own.
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
---
|
|
77
|
+
name: Ledger
|
|
78
|
+
description: Bookkeeping for small studios.
|
|
79
|
+
colors:
|
|
80
|
+
primary: "#0f6e6e"
|
|
81
|
+
surface: "#fbfaf7"
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
# Design System: Ledger
|
|
85
|
+
|
|
86
|
+
## Overview
|
|
87
|
+
|
|
88
|
+
**Creative North Star: "The Lab Notebook"**
|
|
89
|
+
|
|
90
|
+
Calm, precise, approachable. Dense where people work, generous where they
|
|
91
|
+
decide. Not a generic admin dashboard.
|
|
92
|
+
|
|
93
|
+
## Colors
|
|
94
|
+
|
|
95
|
+
- **Ink Teal** (`--primary`): the one key action of a region, nothing else.
|
|
96
|
+
|
|
97
|
+
**The Quiet Ground Rule.** Backgrounds stay neutral; state shows as a soft
|
|
98
|
+
tint, never a strong fill.
|
|
99
|
+
|
|
100
|
+
## Elevation & Depth
|
|
101
|
+
|
|
102
|
+
Flat at rest. Depth comes from tonal surfaces (`--surface`,
|
|
103
|
+
`--surface-raised`), one level deep: no card inside a card.
|
|
104
|
+
|
|
105
|
+
## Do's and Don'ts
|
|
106
|
+
|
|
107
|
+
- **Do** align amounts with tabular figures.
|
|
108
|
+
- **Don't** put two primary actions in one region.
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Map the direction onto Actual CSS
|
|
112
|
+
|
|
113
|
+
`PROJECT.md` turns the roles named in `DESIGN.md` into Actual classes and
|
|
114
|
+
hooks, so every agent writes the same markup for the same intent:
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
Primary action → .btn.primary
|
|
118
|
+
Secondary action → .btn.outline
|
|
119
|
+
Toolbar and row actions → .btn.ghost
|
|
120
|
+
Status labels → .badge.soft + intent
|
|
121
|
+
Dense data views → .compact on the region
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## With a design skill
|
|
125
|
+
|
|
126
|
+
A design skill and the Actual skill do not overlap. The design skill owns the
|
|
127
|
+
direction: product context, visual world, critique. The Actual skill owns the
|
|
128
|
+
implementation: which class, hook or token expresses it. Install both.
|
|
129
|
+
|
|
130
|
+
Design skills differ in what they write. Before adopting one, check:
|
|
131
|
+
|
|
132
|
+
- **Where it records the direction.** A root `DESIGN.md` is shared with every
|
|
133
|
+
other agent; a direction in the skill's own file is read only by that skill.
|
|
134
|
+
- **Whether it scaffolds its own tokens or base stylesheet.** Map its tokens
|
|
135
|
+
onto Actual's in your theme and drop its base and reset rules: Actual
|
|
136
|
+
already ships them.
|
|
137
|
+
- **Which stack it assumes.** Name Actual CSS in the request when its default
|
|
138
|
+
is a utility framework or a component library, or it writes for that one.
|
|
139
|
+
- **Whether it keeps an incumbent design.** Routine changes should stay in
|
|
140
|
+
your system; a redesign is a request you make on purpose.
|
|
141
|
+
|
|
142
|
+
With Impeccable:
|
|
143
|
+
|
|
144
|
+
1. `/impeccable init` writes `PRODUCT.md`.
|
|
145
|
+
2. A new surface or redesign chooses the visual world and seeds `DESIGN.md`.
|
|
146
|
+
3. Implement it in the theme first, then through the
|
|
147
|
+
[decision order](integrating-actual-css.md#10-before-adding-a-css-rule):
|
|
148
|
+
layout primitive, component, hook, utility, application CSS.
|
|
149
|
+
4. `/impeccable document` reads the shipped theme and completes `DESIGN.md`.
|
|
150
|
+
5. `critique`, `audit` and `polish` findings go through the same order. When
|
|
151
|
+
no public hook expresses a product-specific deviation, write focused
|
|
152
|
+
application CSS. Report a missing hook when the need is generic and
|
|
153
|
+
recurring. Never override a component's internal state or behavior.
|
|
154
|
+
|
|
155
|
+
Traps:
|
|
156
|
+
|
|
157
|
+
- The design detector scans sources (`impeccable detect src/`) or a rendered
|
|
158
|
+
page (`impeccable detect http://localhost:3000`). A source scan does not
|
|
159
|
+
resolve the cascade, so confirm any finding about sizes or colors on the
|
|
160
|
+
rendered page: Actual's tokens are inherited.
|
|
161
|
+
- `.impeccable/design.json` holds self-contained preview snippets with `ds-`
|
|
162
|
+
classes for Impeccable's live panel. They are not application code; do not
|
|
163
|
+
copy them into your templates.
|
|
@@ -52,7 +52,7 @@ optimizing — the bare `actual-css` entrypoint and `actual-css/full` both resol
|
|
|
52
52
|
to the complete compiled framework:
|
|
53
53
|
|
|
54
54
|
```html
|
|
55
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/actual-css@0.
|
|
55
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/actual-css@0.19/dist/actual.full.min.css">
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
The package does not maintain separate partial bundles. Modular entrypoints map
|
|
@@ -218,7 +218,7 @@ cells, so they read as a list:
|
|
|
218
218
|
- **Components** — `actual-css/css/components`
|
|
219
219
|
buttons, surfaces, overlays, feedback, navigation, data and composed controls
|
|
220
220
|
- **Effects** — `actual-css/css/effects`
|
|
221
|
-
aura, shimmer
|
|
221
|
+
aura, mark-sweep, reveal, shimmer
|
|
222
222
|
- **Utilities** — `actual-css/css/utilities`
|
|
223
223
|
base and extra utilities
|
|
224
224
|
|
|
@@ -121,6 +121,7 @@ status bar, for example:
|
|
|
121
121
|
| `actual-css/js/tab` | Tab panels and arrow-key navigation (token `tabs`) |
|
|
122
122
|
| `actual-css/js/tooltip` | Tooltips on `data-tooltip` |
|
|
123
123
|
| `actual-css/js/scrollspy` | Scroll-driven nav highlighting (token `scrollspy`) |
|
|
124
|
+
| `actual-css/js/in-view` | One-shot viewport appearance state (token `in-view`) |
|
|
124
125
|
| `actual-css/js/filter` | Input value filtering on `data-filter` |
|
|
125
126
|
| `actual-css/js/mask` | Input masks on `data-mask` |
|
|
126
127
|
| `actual-css/js/password` | Password reveal toggle |
|
|
@@ -145,7 +146,7 @@ The JS is designed to run on its own, without Actual's stylesheet.
|
|
|
145
146
|
|
|
146
147
|
- **`data-enhance` tokens** register named behaviors. The runtime discovers
|
|
147
148
|
components through `data-enhance="tabs"`, `data-enhance="flyout"`, `data-enhance="range"`, `data-enhance="scrollspy"`,
|
|
148
|
-
`data-enhance="validation"`, `data-enhance="dirty"`, and
|
|
149
|
+
`data-enhance="in-view"`, `data-enhance="validation"`, `data-enhance="dirty"`, and
|
|
149
150
|
`data-enhance="ajax"` — no Actual presentation class needed.
|
|
150
151
|
Self-describing attributes (`data-mask`, `data-tooltip`,
|
|
151
152
|
`data-context-menu`) stay framework-neutral by construction.
|
|
@@ -39,7 +39,7 @@ No class or hook is removed: markup and application CSS keep working.
|
|
|
39
39
|
the core focus line and fields now match it.
|
|
40
40
|
- The combobox, date picker and data grid recipes target
|
|
41
41
|
`@lekoala/combobox` 0.8.0, `@lekoala/date-picker` 0.6.1 and
|
|
42
|
-
`data-grid-component` 3.
|
|
42
|
+
`data-grid-component` 3.10.0. Compare a copied bridge with the current one in
|
|
43
43
|
[Combobox](../forms/combobox.md) and [Date picker](../forms/date-picker.md).
|
|
44
44
|
|
|
45
45
|
## 0.13 to 0.14
|
|
@@ -119,7 +119,7 @@ layout.
|
|
|
119
119
|
`var(--focus-outline)` and write the generic line instead:
|
|
120
120
|
|
|
121
121
|
```css
|
|
122
|
-
outline: var(--focus-ring-width) solid var(--focus-outline-color);
|
|
122
|
+
outline: var(--focus-ring-width) solid var(--focus-outline-color, var(--focus));
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
Setting `--focus-outline` still replaces the generic line.
|
|
@@ -122,4 +122,29 @@ CSS scroll markers add one dot per item in Chromium. Other browsers drop these d
|
|
|
122
122
|
|
|
123
123
|
The [card rail template](../../demo/templates/card-rail.html) has the full recipe, focus ring and forced colors included.
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
## Carousel controls
|
|
126
|
+
|
|
127
|
+
CSS scroll buttons and markers add previous/next arrows and dots to a snapped rail without JavaScript. The [carousel template](../../demo/templates/carousel.html) has the full recipe.
|
|
128
|
+
|
|
129
|
+
```css
|
|
130
|
+
.carousel-track {
|
|
131
|
+
scroll-marker-group: after;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.carousel-track::scroll-button(left) {
|
|
135
|
+
content: "‹" / "Previous slide";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.carousel-track::scroll-button(right) {
|
|
139
|
+
content: "›" / "Next slide";
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.carousel-track::scroll-button(*):disabled {
|
|
143
|
+
opacity: 0;
|
|
144
|
+
visibility: hidden;
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
- `::scroll-button()` scrolls one page and disables itself at the end of the rail, so `:disabled` is the edge state.
|
|
149
|
+
- `::scroll-marker` dots need a `data-marker-label` on each item for their accessible name, as in the pagination recipe above.
|
|
150
|
+
- These are progressive enhancements: without them the rail keeps its native scrollbar and swipe. Use a dedicated carousel library such as [Swiper](https://swiperjs.com/) for mouse drag, looping, autoplay, or the same controls in every browser.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Code block with copy button
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Add a copy button to a code block with `.btn`, native code markup and the `enhance()` lifecycle.
|
|
4
4
|
|
|
5
5
|
```html
|
|
6
6
|
<div class="code-block">
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Empty state
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
> Guide users when a list is empty or a search has no results, with a message and an optional next action.
|
|
4
|
+
|
|
5
|
+
Compose the region from layout primitives; there is no empty-state component.
|
|
6
6
|
|
|
7
7
|
**Related terms:** blank slate, zero state, no data, no results, first run,
|
|
8
8
|
placeholder content.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Exclusive accordion
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Keep one accordion panel open at a time with native `<details>` groups, without a JavaScript engine.
|
|
4
4
|
|
|
5
5
|
```html demo
|
|
6
6
|
<details name="faq" open>
|
|
@@ -13,4 +13,5 @@ Browsers that support the `name` attribute on `<details>` get native exclusive a
|
|
|
13
13
|
</details>
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Browsers that support the `name` attribute on `<details>` enforce the group.
|
|
17
|
+
Omit `name` to allow several panels open at once.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Hierarchical scrollable nav
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Build a scrollable sidebar with collapsible navigation groups using native details and existing primitives.
|
|
4
4
|
|
|
5
5
|
**Related terms:** collapsible sidebar, nav group, sub-navigation, nested menu, expandable section, sidebar tree.
|
|
6
6
|
|
|
@@ -37,9 +37,10 @@ App shell with a collapsible nav tree. Uses existing primitives only — no tree
|
|
|
37
37
|
- A group is a `<details>` inside a row `<li>`, never a direct child of the
|
|
38
38
|
`<ul>`. Its `<summary class="nav-link">` takes the row, hover and focus, and
|
|
39
39
|
a chevron that follows the native `[open]` state.
|
|
40
|
-
- The group's links are a nested `.nav-list
|
|
41
|
-
|
|
42
|
-
when the icons are
|
|
40
|
+
- The group's links are a nested `.nav-list`: a rail under the centre of the
|
|
41
|
+
parent's icon, with the labels starting under the parent label. Set
|
|
42
|
+
`--nav-list-icon-size` on the nav when the icons are not 1em, and
|
|
43
|
+
`--nav-list-rail-color: transparent` for a plain indent without the line.
|
|
43
44
|
- `.overline` labels a section of the nav.
|
|
44
45
|
- `<details name="…">` makes the groups an exclusive accordion, without
|
|
45
46
|
JavaScript.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Icon slot
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
> Compose a stable icon box for notifications, activity feeds and cards, using existing layout primitives.
|
|
4
|
+
|
|
5
|
+
Use an icon slot for a leading icon, an icon disc or a status marker. There
|
|
6
|
+
is no dedicated primitive; compose the contract from existing pieces.
|
|
7
7
|
|
|
8
8
|
A contained icon zone must be a **stable box** that never shrinks, always
|
|
9
9
|
centers its glyph, and clips overflow:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Intent nesting
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
own default intent unless you give them one:
|
|
3
|
+
Apply an intent to each component independently, so nested buttons and controls keep their own colors.
|
|
5
4
|
|
|
6
5
|
```html
|
|
7
6
|
<div class="alert danger">
|
|
@@ -12,4 +11,4 @@ own default intent unless you give them one:
|
|
|
12
11
|
```
|
|
13
12
|
|
|
14
13
|
The alert uses danger colors, Dismiss stays neutral, and Retry uses primary.
|
|
15
|
-
|
|
14
|
+
Nested components keep their default intent unless you give them one.
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
# Navigation list
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
chrome, stacks the rows and stretches each `.nav-link` across the row. For a
|
|
5
|
-
horizontal row of links, use `.cluster` on the list, which removes the list
|
|
6
|
-
chrome too.
|
|
3
|
+
Arrange navigation links in vertical lists or horizontal rows using `.nav-list` and `.cluster`.
|
|
7
4
|
|
|
8
5
|
```html demo
|
|
9
6
|
<div class="stack">
|
|
@@ -27,6 +24,12 @@ chrome too.
|
|
|
27
24
|
</div>
|
|
28
25
|
```
|
|
29
26
|
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
`.nav-list` removes native list chrome, stacks the rows and stretches each
|
|
30
|
+
`.nav-link` across the row. For a horizontal row of links, use `.cluster` on
|
|
31
|
+
the list, which removes the list chrome too.
|
|
32
|
+
|
|
30
33
|
Do not reset every list inside `nav`.
|
|
31
34
|
|
|
32
35
|
```css
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Stat
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
> Present a key figure with its label, supporting detail and optional trend for dashboards and KPI cards.
|
|
4
|
+
|
|
5
|
+
Compose it from a card, a grid and a badge; there is no stat component.
|
|
6
6
|
|
|
7
7
|
**Related terms:** KPI, metric, statistic, figure, stat card, number tile,
|
|
8
8
|
delta, trend indicator.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Structured lists
|
|
2
2
|
|
|
3
|
-
Choose list markup
|
|
4
|
-
component contract the collection needs.
|
|
3
|
+
Choose semantic list markup and compose the layout or component treatment that fits the collection.
|
|
5
4
|
|
|
6
5
|
| Need | Use |
|
|
7
6
|
| ----------------------------------------------- | ----------------------------------- |
|
package/llms.txt
CHANGED
|
@@ -19,7 +19,7 @@ Actual CSS uses a small public grammar: `.component [intent] [variant] [size] [m
|
|
|
19
19
|
- `actual-css/reserved-classes.json` — machine-readable list of the framework-owned class namespace. Use it to check whether a class belongs to Actual CSS and to validate claimed framework classes; application-specific classes are expected to exist outside this manifest.
|
|
20
20
|
- `actual-css/components.json` — machine-readable component index, derived from the sources (CSS headers, selectors, package exports, `src/js`) by `scripts/build-catalog.js` and verified by `check:catalog`. Gives each component its import paths, owned classes, hooks, states, registered enhancement tokens, and published `docs` URL — enough to know what exists and where to read more, not a replacement for the docs pages.
|
|
21
21
|
- `actual-css/tokens.json` — the public global tokens (`global`), derived by the same script from `src/css/core`. Use it to check that a `var(--…)` outside a component exists; component hooks are in `components.json`.
|
|
22
|
-
- [Starter agent skill](skills/actual-css/SKILL.md) — a copyable skill for building with Actual CSS (vocabulary, hooks, layouts, enhancements); consuming projects extend it with a local `PROJECT.md
|
|
22
|
+
- [Starter agent skill](skills/actual-css/SKILL.md) — a copyable skill for building with Actual CSS (vocabulary, hooks, layouts, enhancements); consuming projects extend it with a local `PROJECT.md`; visual direction lives in the project's own `DESIGN.md` ([Coding agents and DESIGN.md](docs/pages/guides/coding-agents.md)).
|
|
23
23
|
- Individual families and modules are importable separately (`actual-css/css/components`, `actual-css/css/layout/grid`, `actual-css/js/dialog`, …); see [README](README.md) and [Modular imports](docs/pages/guides/modular-import.md).
|
|
24
24
|
|
|
25
25
|
Forms are the one family with two aggregate entrypoints:
|
|
@@ -31,7 +31,8 @@ show supported CSS modules and individual enhancer imports without duplicating
|
|
|
31
31
|
the full export list here.
|
|
32
32
|
|
|
33
33
|
Presentation (`class`) and behavior are separate layers. `data-enhance` takes
|
|
34
|
-
|
|
34
|
+
named tokens (`tabs`, `flyout`, `range`, `scrollspy`, `in-view`, `validation`,
|
|
35
|
+
`dirty`, `ajax`, `dialog`).
|
|
35
36
|
Leaf behaviors whose opt-in also carries configuration use their own attribute
|
|
36
37
|
(`data-tooltip`, `data-mask`, `data-filter`, `data-context-menu`), and `<dialog>`
|
|
37
38
|
needs none. See
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "actual-css",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
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",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"./js/focus": "./src/js/focus.js",
|
|
63
63
|
"./js/focus-group": "./src/js/focus-group.js",
|
|
64
64
|
"./js/input": "./src/js/input.js",
|
|
65
|
+
"./js/in-view": "./src/js/in-view.js",
|
|
65
66
|
"./js/keys": "./src/js/keys.js",
|
|
66
67
|
"./js/mask": "./src/js/mask.js",
|
|
67
68
|
"./js/menu": "./src/js/menu.js",
|
|
@@ -131,6 +132,7 @@
|
|
|
131
132
|
"report:neutral-ramp": "bun scripts/report-neutral-ramp.js",
|
|
132
133
|
"report:dead-css": "bun scripts/report-dead-css.js",
|
|
133
134
|
"report:overflow": "bun scripts/report-overflow.js",
|
|
135
|
+
"report:paint": "bun scripts/report-paint.js",
|
|
134
136
|
"check:architecture": "bun scripts/check-css-architecture.js",
|
|
135
137
|
"build:dist": "bun scripts/build-dist.js",
|
|
136
138
|
"build:js": "bun scripts/build-js.js",
|