actual-css 0.9.2 → 0.10.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 +96 -0
- package/README.md +65 -44
- package/components.json +33 -13
- package/dist/actual.full.css +585 -499
- package/dist/actual.full.js +1 -1
- package/dist/actual.full.min.css +1 -1
- package/docs/design-notes/app-ui.md +1 -1
- package/docs/design-notes/column-layout.md +103 -520
- package/docs/design-notes/forced-colors.md +12 -1
- package/docs/design-notes/naming.md +1 -1
- package/docs/design-notes/surface-reparenting.md +8 -9
- package/docs/navigation.json +2 -0
- package/docs/pages/components/accordion.md +55 -1
- package/docs/pages/components/alert.md +9 -15
- package/docs/pages/components/badge.md +6 -7
- package/docs/pages/components/bleed.md +42 -0
- package/docs/pages/components/button.md +30 -4
- package/docs/pages/components/card.md +21 -86
- package/docs/pages/components/close.md +48 -0
- package/docs/pages/components/data-list.md +26 -1
- package/docs/pages/components/dialog.md +16 -16
- package/docs/pages/components/drawer.md +9 -9
- package/docs/pages/components/navbar.md +5 -5
- package/docs/pages/components/spinner.md +3 -3
- package/docs/pages/enhancements/overview.md +5 -0
- package/docs/pages/enhancements/tooltip.md +3 -1
- package/docs/pages/examples/overview.md +2 -1
- package/docs/pages/forms/choice-cards.md +39 -0
- package/docs/pages/forms/combobox.md +23 -11
- package/docs/pages/forms/joined-controls.md +2 -5
- package/docs/pages/forms/overview.md +6 -0
- package/docs/pages/foundations/theming.md +64 -18
- package/docs/pages/foundations/tokens.md +28 -10
- package/docs/pages/guides/introduction.md +15 -23
- package/docs/pages/guides/modular-import.md +53 -6
- package/docs/pages/guides/progressive-enhancement.md +6 -3
- package/docs/pages/guides/tailwind.md +17 -5
- package/docs/pages/layout/column-layout.md +92 -54
- package/docs/pages/layout/media.md +1 -1
- package/docs/pages/layout/overview.md +1 -1
- package/docs/pages/utilities/overview.md +1 -1
- package/docs/pages/utilities/sizing-wrapping.md +5 -3
- package/llms.txt +24 -4
- package/package.json +6 -6
- package/reserved-classes.json +5 -30
- package/skills/actual-css/PROJECT.md.example +65 -0
- package/skills/actual-css/README.md +64 -0
- package/skills/actual-css/SKILL.md +234 -0
- package/skills/actual-css/references/accessibility.md +44 -0
- package/skills/actual-css/references/api-and-vocabulary.md +94 -0
- package/skills/actual-css/references/enhancements.md +59 -0
- package/skills/actual-css/references/forms.md +49 -0
- package/skills/actual-css/references/layout-and-theming.md +82 -0
- package/skills/actual-css/references/review-checklist.md +51 -0
- package/skills/actual-css/scripts/inspect-actual-css.mjs +171 -0
- package/src/css/components/accordion.css +44 -7
- package/src/css/components/alert.css +23 -43
- package/src/css/components/app-nav.css +9 -0
- package/src/css/components/badge.css +11 -39
- package/src/css/components/bleed.css +79 -0
- package/src/css/components/button.css +6 -17
- package/src/css/components/card.css +7 -40
- package/src/css/components/close.css +91 -0
- package/src/css/components/data-list.css +18 -0
- package/src/css/components/drawer.css +15 -56
- package/src/css/components/fab.css +10 -0
- package/src/css/components/flyout.css +1 -0
- package/src/css/components/index.css +2 -0
- package/src/css/components/join.css +36 -20
- package/src/css/components/menu.css +12 -0
- package/src/css/components/modal.css +10 -57
- package/src/css/components/navbar.css +27 -0
- package/src/css/core/focus.css +9 -3
- package/src/css/core/theme.css +25 -43
- package/src/css/core/tokens.css +1 -1
- package/src/css/core/variants.css +3 -33
- package/src/css/forms/choice-card.css +74 -4
- package/src/css/forms/choice.css +2 -3
- package/src/css/forms/control.css +15 -8
- package/src/css/forms/custom-select.css +4 -4
- package/src/css/forms/native.css +4 -4
- package/src/css/forms/range.css +23 -8
- package/src/css/forms/switch.css +2 -3
- package/src/css/layout/app-layout.css +1 -1
- package/src/css/layout/column-layout.css +26 -111
- package/src/css/utilities/extra.css +7 -6
- package/src/js/dialog.js +95 -24
- package/src/js/enhance.js +7 -3
- package/src/js/escape.js +1 -0
- package/src/js/flyout.js +10 -1
- package/src/js/focus-group.js +2 -1
- package/src/js/keys.js +14 -0
- package/src/js/menu.js +2 -1
- package/src/js/status.js +19 -0
- package/src/js/surface.js +12 -8
- package/src/js/tab.js +2 -1
- package/src/js/tooltip.js +18 -1
- package/src/js/validation.js +5 -6
- package/dist/actual.css +0 -876
- package/dist/actual.js +0 -1
- package/dist/actual.min.css +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Project-specific Actual CSS usage
|
|
2
|
+
|
|
3
|
+
Copy this file to `PROJECT.md` beside `SKILL.md` and keep only decisions that are true for this application.
|
|
4
|
+
|
|
5
|
+
This file narrows **how the application uses Actual CSS**. It does not redefine Actual CSS API.
|
|
6
|
+
|
|
7
|
+
## Imports
|
|
8
|
+
|
|
9
|
+
CSS loaded by this project:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
- TODO
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
JavaScript enhancers loaded by this project:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
- TODO
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Theme
|
|
22
|
+
|
|
23
|
+
Theme root / selector:
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
TODO
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Application-owned brand tokens or theme conventions:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
- TODO
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Page shell and layout conventions
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
- TODO
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Existing application wrappers
|
|
42
|
+
|
|
43
|
+
List server-side/template components that agents should reuse before writing raw markup.
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
- TODO
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Application CSS conventions
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
- TODO
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Browser policy
|
|
56
|
+
|
|
57
|
+
If stricter than Actual CSS itself:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
TODO
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Local decisions
|
|
64
|
+
|
|
65
|
+
Add only stable, reusable decisions that materially change implementation choices.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Actual CSS starter skill
|
|
2
|
+
|
|
3
|
+
A small, copyable agent skill for **building with Actual CSS**.
|
|
4
|
+
|
|
5
|
+
It is intentionally not a contributor guide for the Actual CSS repository. Repository development workflow belongs in `AGENTS.md`; this skill teaches consumers how to use the framework without inventing API or duplicating framework behavior.
|
|
6
|
+
|
|
7
|
+
## Contents
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
actual-css/
|
|
11
|
+
├── SKILL.md
|
|
12
|
+
├── README.md
|
|
13
|
+
├── PROJECT.md.example
|
|
14
|
+
├── references/
|
|
15
|
+
│ ├── accessibility.md
|
|
16
|
+
│ ├── api-and-vocabulary.md
|
|
17
|
+
│ ├── enhancements.md
|
|
18
|
+
│ ├── forms.md
|
|
19
|
+
│ ├── layout-and-theming.md
|
|
20
|
+
│ └── review-checklist.md
|
|
21
|
+
└── scripts/
|
|
22
|
+
└── inspect-actual-css.mjs
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Recommended distribution
|
|
26
|
+
|
|
27
|
+
Actual CSS can ship this directory as a starter/reference skill. Consuming projects copy it into the location their coding agent uses for skills.
|
|
28
|
+
|
|
29
|
+
The copied skill should remain mostly framework-generic. Application-specific choices belong in a local `PROJECT.md` created from `PROJECT.md.example`.
|
|
30
|
+
|
|
31
|
+
This gives a clean split:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
Actual CSS package/docs/manifests
|
|
35
|
+
-> what exists and how the framework works
|
|
36
|
+
|
|
37
|
+
SKILL.md + references
|
|
38
|
+
-> how an agent should build with it
|
|
39
|
+
|
|
40
|
+
PROJECT.md
|
|
41
|
+
-> how this application chooses to use it
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Why the skill does not bundle the catalog
|
|
45
|
+
|
|
46
|
+
`components.json`, `reserved-classes.json`, package exports, CSS source, and JS source are intentionally read from the installed Actual CSS version. Copying those files into the skill would create a second, quickly stale API snapshot.
|
|
47
|
+
|
|
48
|
+
The bundled inspector makes common lookups cheap:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
node /path/to/actual-css/scripts/inspect-actual-css.mjs --source
|
|
52
|
+
node /path/to/actual-css/scripts/inspect-actual-css.mjs button
|
|
53
|
+
node /path/to/actual-css/scripts/inspect-actual-css.mjs --class compact
|
|
54
|
+
node /path/to/actual-css/scripts/inspect-actual-css.mjs --exports
|
|
55
|
+
node /path/to/actual-css/scripts/inspect-actual-css.mjs --enhancements
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Set `ACTUAL_CSS_ROOT=/path/to/actual-css` to inspect a specific checkout or installed package.
|
|
59
|
+
|
|
60
|
+
## Customize, do not fork the framework contract
|
|
61
|
+
|
|
62
|
+
Good project customizations include which modules are loaded, local theme tokens, server/template wrappers, page-shell conventions, browser policy, and application class naming.
|
|
63
|
+
|
|
64
|
+
Do not use the project layer to redefine Actual CSS class meanings, internal runtime state, package exports, or undocumented hooks.
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: actual-css
|
|
3
|
+
description: Build and review application UI with Actual CSS. Use when choosing Actual CSS imports, classes, layout primitives, theme tokens, component hooks, forms, progressive enhancements, accessibility behavior, or when deciding whether CSS/JS belongs in Actual CSS or application code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Actual CSS
|
|
7
|
+
|
|
8
|
+
Use Actual CSS as a **UI vocabulary and behavior kit**, not as a stylesheet to fight.
|
|
9
|
+
|
|
10
|
+
The target is not zero application CSS. The target is:
|
|
11
|
+
|
|
12
|
+
> no duplicated framework behavior, no invented Actual API, and no palette literals scattered outside the theme/token layer.
|
|
13
|
+
|
|
14
|
+
## Start from the installed API
|
|
15
|
+
|
|
16
|
+
Actual CSS may evolve between releases. Resolve uncertain API from the version used by the current project, in this order:
|
|
17
|
+
|
|
18
|
+
1. `actual-css/components.json` — component index: classes, public hooks, states, CSS/JS imports, enhancement tokens.
|
|
19
|
+
2. `actual-css/reserved-classes.json` — framework-owned class namespace.
|
|
20
|
+
3. `actual-css/package.json#exports` — canonical package entrypoints.
|
|
21
|
+
4. `actual-css/src/css/` and `actual-css/src/js/` — exact selectors, defaults, state ownership, and runtime behavior.
|
|
22
|
+
5. `actual-css/docs/` and `actual-css/llms.txt` — intended usage and concise architecture guidance.
|
|
23
|
+
|
|
24
|
+
If this skill was copied into a consuming project, the installed package wins over examples or summaries in this skill.
|
|
25
|
+
|
|
26
|
+
Use the bundled inspector when useful:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
node <skill>/scripts/inspect-actual-css.mjs --source
|
|
30
|
+
node <skill>/scripts/inspect-actual-css.mjs button
|
|
31
|
+
node <skill>/scripts/inspect-actual-css.mjs --class compact
|
|
32
|
+
node <skill>/scripts/inspect-actual-css.mjs --exports
|
|
33
|
+
node <skill>/scripts/inspect-actual-css.mjs --enhancements
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If `PROJECT.md` exists beside this file, read it after resolving the Actual CSS API. It contains application-specific choices, not framework API.
|
|
37
|
+
|
|
38
|
+
## Decision order
|
|
39
|
+
|
|
40
|
+
Before writing application CSS, ask in this order:
|
|
41
|
+
|
|
42
|
+
1. **Theme** — can semantic tokens express the visual requirement?
|
|
43
|
+
2. **Layout relationship** — does an Actual layout primitive express how the children relate?
|
|
44
|
+
3. **Component** — is there already a component or pattern for the structure?
|
|
45
|
+
4. **Public hook** — can a documented custom property tune it?
|
|
46
|
+
5. **Utility** — does an existing small utility express the adjustment?
|
|
47
|
+
6. **Application CSS** — is the remaining requirement genuinely product-specific?
|
|
48
|
+
|
|
49
|
+
Use Actual for generic structure and behavior. Use application CSS for product identity, unusual geometry, bespoke animation, and product-specific composition.
|
|
50
|
+
|
|
51
|
+
Do not preserve incidental mockup pixels by default. Resolve designs toward the system first.
|
|
52
|
+
|
|
53
|
+
## Public class grammar
|
|
54
|
+
|
|
55
|
+
Actual CSS intentionally uses unprefixed global classes:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
.component [intent] [variant] [size] [modifier]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Example:
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<button class="btn primary outline lg">Publish</button>
|
|
65
|
+
<span class="badge success soft">Online</span>
|
|
66
|
+
<section class="card raised stack">...</section>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Rules:
|
|
70
|
+
|
|
71
|
+
- Compose intents and variants; do not invent `.btn-primary`-style compounds.
|
|
72
|
+
- `.sm` / `.lg` are size modifiers; `.compact` / `.spacious` are density contexts.
|
|
73
|
+
- Undocumented `is-*` classes are runtime state, not author API.
|
|
74
|
+
- Component-specific modifiers only mean what their component documents.
|
|
75
|
+
- Do not invent breakpoint/state utility syntax or arbitrary-value utilities.
|
|
76
|
+
- Do not recreate a generic spacing scale; use layout rhythm, density, hooks, or local CSS.
|
|
77
|
+
- Before introducing a generic-looking application class, check `reserved-classes.json`.
|
|
78
|
+
|
|
79
|
+
See `references/api-and-vocabulary.md`.
|
|
80
|
+
|
|
81
|
+
## Imports
|
|
82
|
+
|
|
83
|
+
Use the smallest package surface consistent with the project's policy.
|
|
84
|
+
|
|
85
|
+
```css
|
|
86
|
+
@import "actual-css/css"; /* source core */
|
|
87
|
+
@import "actual-css/css/layout";
|
|
88
|
+
@import "actual-css/css/forms/all";
|
|
89
|
+
@import "actual-css/css/components/button";
|
|
90
|
+
|
|
91
|
+
@import "actual-css/full"; /* complete compiled framework, zero-config */
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Forms are intentionally split:
|
|
95
|
+
|
|
96
|
+
- `actual-css/css/forms` — native-control baseline.
|
|
97
|
+
- `actual-css/css/forms/all` — complete forms family.
|
|
98
|
+
|
|
99
|
+
The minimal core does not imply that layout, forms, components, typography, effects, or utilities are loaded.
|
|
100
|
+
|
|
101
|
+
Import JavaScript behavior independently when possible:
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
import "actual-css/js/flyout";
|
|
105
|
+
import "actual-css/js/tooltip";
|
|
106
|
+
import "actual-css/js/validation";
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Check the installed package exports before assuming an entrypoint exists.
|
|
110
|
+
|
|
111
|
+
See `references/api-and-vocabulary.md`.
|
|
112
|
+
|
|
113
|
+
## Layout and theming
|
|
114
|
+
|
|
115
|
+
Choose layout from the **relationship between children**, not from the number of columns visible in one mockup:
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
vertical flow -> .stack
|
|
119
|
+
wrapping inline peers -> .cluster
|
|
120
|
+
responsive repeated items -> .grid
|
|
121
|
+
known equal peer density -> .grid-N
|
|
122
|
+
peers that switch together -> .switcher
|
|
123
|
+
main content + secondary region -> .sidebar-layout
|
|
124
|
+
fixed media + flexible content -> .media
|
|
125
|
+
explicit shared 12-column placement -> .column-layout
|
|
126
|
+
custom exact tracks -> .grid + --grid-columns
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Do not choose `.app-layout` merely because the product is an application; it is a specific viewport shell with internal scrolling and adaptive navigation.
|
|
130
|
+
|
|
131
|
+
Prefer documented public hooks over replacement rules. Keep palette literals in the theme/token layer and derive decorative colors from semantic tokens.
|
|
132
|
+
|
|
133
|
+
Treat state-owned, derived, relay, runtime-written, or undocumented custom properties as internal unless the docs explicitly expose them.
|
|
134
|
+
|
|
135
|
+
See `references/layout-and-theming.md`.
|
|
136
|
+
|
|
137
|
+
## Forms
|
|
138
|
+
|
|
139
|
+
Prefer native input semantics first. Actual CSS enhances them; it does not replace domain validation.
|
|
140
|
+
|
|
141
|
+
- `inputmode` is a keyboard hint, not filtering.
|
|
142
|
+
- `data-filter` explicitly rewrites values; an empty `data-filter` does nothing.
|
|
143
|
+
- `data-mask` enforces shape, not domain validity.
|
|
144
|
+
- Do not mask telephone numbers by default. Normalize and validate authoritative phone semantics on the server.
|
|
145
|
+
- Native HTML validation remains the baseline; `data-enhance="validation"` adds state/focus behavior and small custom rules.
|
|
146
|
+
- Connect inline help/errors with `aria-describedby`; synchronize invalid state with `aria-invalid`.
|
|
147
|
+
|
|
148
|
+
See `references/forms.md`.
|
|
149
|
+
|
|
150
|
+
## Progressive enhancement
|
|
151
|
+
|
|
152
|
+
Keep four concerns separate:
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
class = presentation
|
|
156
|
+
HTML / ARIA = semantics
|
|
157
|
+
data-enhance = controller opt-in
|
|
158
|
+
data-* = feature configuration or leaf opt-in
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
`data-enhance` is not a prefix for every JavaScript feature. Verify the installed enhancement vocabulary rather than inventing a token.
|
|
162
|
+
|
|
163
|
+
Leaf behaviors can be self-describing through attributes such as `data-tooltip`, `data-mask`, `data-filter`, or `data-context-menu`. Native `<dialog>` is its own semantic opt-in.
|
|
164
|
+
|
|
165
|
+
CSS must not depend on `data-enhance` or runtime transport markers.
|
|
166
|
+
|
|
167
|
+
For application-specific widgets, reuse Actual's JS primitives for lifecycle, surfaces, focus, keyboard navigation, input rewriting, and events before recreating those policies.
|
|
168
|
+
|
|
169
|
+
See `references/enhancements.md`.
|
|
170
|
+
|
|
171
|
+
## Surface ownership
|
|
172
|
+
|
|
173
|
+
A floating surface must have one lifecycle owner.
|
|
174
|
+
|
|
175
|
+
When Actual manages a surface or tooltip, application code must not compete for its Popover lifecycle or runtime positioning. Do not reparent managed surfaces to `body` as a workaround; the native top-layer transport is specifically used to preserve authored DOM context and inheritance.
|
|
176
|
+
|
|
177
|
+
Use a flyout/dialog for interactive floating content. Tooltips are supplemental, non-interactive content.
|
|
178
|
+
|
|
179
|
+
See `references/enhancements.md`.
|
|
180
|
+
|
|
181
|
+
## Accessibility
|
|
182
|
+
|
|
183
|
+
- Prefer native `button`, `a`, `details`, `dialog`, and form controls.
|
|
184
|
+
- Preserve visible keyboard focus.
|
|
185
|
+
- Name icon-only controls.
|
|
186
|
+
- Do not communicate state with color alone.
|
|
187
|
+
- Match ARIA roles with the keyboard behavior they require.
|
|
188
|
+
- Keep persistent or critical information out of tooltip/status-only UI.
|
|
189
|
+
- Consider reduced motion and forced colors for custom interactive states.
|
|
190
|
+
|
|
191
|
+
See `references/accessibility.md`.
|
|
192
|
+
|
|
193
|
+
## Project customization
|
|
194
|
+
|
|
195
|
+
This starter describes **Actual CSS itself**. A consuming application should add its local choices in `PROJECT.md`, not rewrite framework facts.
|
|
196
|
+
|
|
197
|
+
Useful project-specific additions include:
|
|
198
|
+
|
|
199
|
+
- loaded CSS families/modules;
|
|
200
|
+
- loaded JS enhancers;
|
|
201
|
+
- theme root and brand tokens;
|
|
202
|
+
- page-shell conventions;
|
|
203
|
+
- server-side component/template wrappers already available;
|
|
204
|
+
- application class naming rules;
|
|
205
|
+
- stricter browser-support requirements;
|
|
206
|
+
- product-specific composition conventions.
|
|
207
|
+
|
|
208
|
+
Start from `PROJECT.md.example`.
|
|
209
|
+
|
|
210
|
+
Project rules may narrow how Actual CSS is used, but must not invent or redefine Actual CSS public API.
|
|
211
|
+
|
|
212
|
+
## Task index
|
|
213
|
+
|
|
214
|
+
Use the smallest reference that answers the question:
|
|
215
|
+
|
|
216
|
+
- classes, components, imports, manifests -> `references/api-and-vocabulary.md`
|
|
217
|
+
- tokens, hooks, layout, custom CSS -> `references/layout-and-theming.md`
|
|
218
|
+
- fields, filtering, masks, validation -> `references/forms.md`
|
|
219
|
+
- flyouts, tooltips, dialogs, custom JS widgets -> `references/enhancements.md`
|
|
220
|
+
- focus, ARIA, browser/runtime assumptions -> `references/accessibility.md`
|
|
221
|
+
- final consumer review -> `references/review-checklist.md`
|
|
222
|
+
|
|
223
|
+
## Completion check
|
|
224
|
+
|
|
225
|
+
Before considering an Actual CSS UI change complete:
|
|
226
|
+
|
|
227
|
+
- No invented Actual class, variant, hook, enhancement token, or package export.
|
|
228
|
+
- Existing framework layout/component behavior was not reimplemented unnecessarily.
|
|
229
|
+
- Public hooks were considered before replacement CSS.
|
|
230
|
+
- Palette literals remain centralized in the theme/token layer unless genuinely product-specific and derived appropriately.
|
|
231
|
+
- Semantic HTML and ARIA do not depend on CSS class names.
|
|
232
|
+
- JavaScript behavior and presentation stay decoupled.
|
|
233
|
+
- Focus and relevant disabled/current/selected/expanded states remain accessible.
|
|
234
|
+
- The implementation matches the Actual CSS version actually used by the project.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Accessibility and runtime assumptions
|
|
2
|
+
|
|
3
|
+
## Accessible defaults
|
|
4
|
+
|
|
5
|
+
- Prefer native interactive elements.
|
|
6
|
+
- Preserve visible keyboard focus.
|
|
7
|
+
- Name icon-only controls.
|
|
8
|
+
- Do not rely on color alone to communicate state.
|
|
9
|
+
- Connect form help/errors to controls.
|
|
10
|
+
- Keep persistent or critical information out of tooltip/status-only UI.
|
|
11
|
+
- Respect reduced motion and forced colors in custom states.
|
|
12
|
+
|
|
13
|
+
## Focus
|
|
14
|
+
|
|
15
|
+
Actual's core provides a focus baseline. Components may enhance it, but application styling must not remove visible keyboard focus without an equivalent accessible treatment.
|
|
16
|
+
|
|
17
|
+
When replacing focus visuals, consider forced-colors behavior as well as normal color modes.
|
|
18
|
+
|
|
19
|
+
## Roles and keyboard behavior
|
|
20
|
+
|
|
21
|
+
Do not claim an ARIA role only because it sounds semantically close. Roles such as toolbar, menu, tablist, listbox, or grid imply interaction and keyboard expectations.
|
|
22
|
+
|
|
23
|
+
Prefer native semantics where they fit, and only add ARIA needed to express behavior that native HTML does not already convey.
|
|
24
|
+
|
|
25
|
+
## Interactive states
|
|
26
|
+
|
|
27
|
+
For custom treatment of controls, consider relevant states such as:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
rest
|
|
31
|
+
hover
|
|
32
|
+
active / pressed
|
|
33
|
+
focus-visible
|
|
34
|
+
disabled
|
|
35
|
+
selected / current / expanded
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Do not make hover the only indication that something is interactive.
|
|
39
|
+
|
|
40
|
+
## Browser policy
|
|
41
|
+
|
|
42
|
+
Read the installed Actual CSS browser-support documentation for exact supported versions. Do not add legacy compatibility wrappers merely from habit.
|
|
43
|
+
|
|
44
|
+
Actual's runtime intentionally relies on modern platform primitives when they are within its documented JavaScript support floor. Project-specific browser requirements can be stricter and belong in `PROJECT.md`.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# API and vocabulary
|
|
2
|
+
|
|
3
|
+
## Source of truth
|
|
4
|
+
|
|
5
|
+
Use the installed version rather than guessing from names:
|
|
6
|
+
|
|
7
|
+
- `components.json` — component classes, hooks, states, CSS/JS imports, enhancement tokens.
|
|
8
|
+
- `reserved-classes.json` — whether Actual CSS owns a class name.
|
|
9
|
+
- `package.json#exports` — supported package entrypoints.
|
|
10
|
+
- CSS/JS source — exact behavior and defaults.
|
|
11
|
+
- docs / `llms.txt` — intended usage and framework map.
|
|
12
|
+
|
|
13
|
+
`components.json` is an index, not a replacement for component documentation or source.
|
|
14
|
+
|
|
15
|
+
## Class grammar
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
.component [intent] [variant] [size] [modifier]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Typical intent/variant composition looks like:
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<button class="btn primary outline lg">Publish</button>
|
|
25
|
+
<span class="badge success soft">Online</span>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Do not infer API from plausible names.
|
|
29
|
+
|
|
30
|
+
Actual CSS intentionally does not provide:
|
|
31
|
+
|
|
32
|
+
- compound intent classes such as `.btn-primary`;
|
|
33
|
+
- Tailwind-style breakpoint/state prefixes;
|
|
34
|
+
- arbitrary-value utilities;
|
|
35
|
+
- a generic spacing scale such as `mt-4` / `p-2`;
|
|
36
|
+
- author-facing `is-*` state conventions;
|
|
37
|
+
- a generic presentation class just because an internal JS primitive has that name.
|
|
38
|
+
|
|
39
|
+
Before introducing a generic application class (`stacked`, `actions`, `flush`, `muted`, etc.), check the reserved namespace. If Actual owns the name, use its documented meaning or choose a product-specific application name.
|
|
40
|
+
|
|
41
|
+
## CSS imports
|
|
42
|
+
|
|
43
|
+
Common aggregate entrypoints:
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
@import "actual-css/css"; /* source core */
|
|
47
|
+
@import "actual-css/css/typography";
|
|
48
|
+
@import "actual-css/css/layout";
|
|
49
|
+
@import "actual-css/css/forms";
|
|
50
|
+
@import "actual-css/css/forms/all";
|
|
51
|
+
@import "actual-css/css/components";
|
|
52
|
+
@import "actual-css/css/effects";
|
|
53
|
+
@import "actual-css/css/utilities";
|
|
54
|
+
|
|
55
|
+
@import "actual-css/full"; /* complete compiled framework, zero-config */
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Individual modules are available through domain paths when exported, for example:
|
|
59
|
+
|
|
60
|
+
```css
|
|
61
|
+
@import "actual-css/css/layout/grid";
|
|
62
|
+
@import "actual-css/css/components/button";
|
|
63
|
+
@import "actual-css/css/components/card";
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The minimal core intentionally excludes the functional families above.
|
|
67
|
+
|
|
68
|
+
Forms have two aggregate entrypoints:
|
|
69
|
+
|
|
70
|
+
- `forms` = native-control baseline.
|
|
71
|
+
- `forms/all` = complete forms family.
|
|
72
|
+
|
|
73
|
+
## JavaScript imports
|
|
74
|
+
|
|
75
|
+
Import only the behavior the application intends to use, or deliberately choose the full runtime.
|
|
76
|
+
|
|
77
|
+
Examples:
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
import "actual-css/js/flyout";
|
|
81
|
+
import "actual-css/js/tooltip";
|
|
82
|
+
import "actual-css/js/validation";
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Do not assume `actual-css/js` means "all enhancers". Check the current exports.
|
|
86
|
+
|
|
87
|
+
## Lookup helper
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
node <skill>/scripts/inspect-actual-css.mjs button
|
|
91
|
+
node <skill>/scripts/inspect-actual-css.mjs --class flyout
|
|
92
|
+
node <skill>/scripts/inspect-actual-css.mjs --exports
|
|
93
|
+
node <skill>/scripts/inspect-actual-css.mjs --enhancements
|
|
94
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Enhancements and floating surfaces
|
|
2
|
+
|
|
3
|
+
## Four independent layers
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
class presentation
|
|
7
|
+
HTML / ARIA semantics
|
|
8
|
+
data-enhance root-controller behavior opt-in
|
|
9
|
+
data-* feature configuration or leaf opt-in
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
A component may use all four, but they are not interchangeable.
|
|
13
|
+
|
|
14
|
+
Do not make CSS selectors depend on `data-enhance` or internal runtime transport markers.
|
|
15
|
+
|
|
16
|
+
## `data-enhance`
|
|
17
|
+
|
|
18
|
+
Use a token for a controller that owns a subtree. Verify current supported tokens from the installed version.
|
|
19
|
+
|
|
20
|
+
Self-describing leaf behavior should use the feature's own documented attribute, such as tooltip/filter/mask/context-menu attributes, rather than inventing an enhancement token.
|
|
21
|
+
|
|
22
|
+
Native `<dialog>` is semantically self-describing and does not need a generic enhancement token merely to be a dialog.
|
|
23
|
+
|
|
24
|
+
## Custom widgets
|
|
25
|
+
|
|
26
|
+
Before implementing lifecycle, focus, Escape handling, keyboard navigation, input rewriting, or floating-surface policy from scratch, inspect the exported Actual JS primitives.
|
|
27
|
+
|
|
28
|
+
Common responsibilities may already be covered by modules such as:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
enhance
|
|
32
|
+
surface
|
|
33
|
+
focus-group
|
|
34
|
+
keys
|
|
35
|
+
menu
|
|
36
|
+
focus
|
|
37
|
+
input
|
|
38
|
+
filter
|
|
39
|
+
events
|
|
40
|
+
command
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Use the current package exports as the source of truth.
|
|
44
|
+
|
|
45
|
+
## One surface owner
|
|
46
|
+
|
|
47
|
+
A floating panel must have one lifecycle owner.
|
|
48
|
+
|
|
49
|
+
When Actual's runtime manages a surface, application code must not simultaneously own its Popover opening/closing or runtime positioning. Do not combine independent native/third-party lifecycle with Actual management on the same panel.
|
|
50
|
+
|
|
51
|
+
Actual-managed surfaces use top-layer transport while remaining in their authored DOM position. Do not reparent them to `body` to escape clipping; preserving inherited theme/density/custom-property context is part of the transport design.
|
|
52
|
+
|
|
53
|
+
## Flyout vs tooltip
|
|
54
|
+
|
|
55
|
+
Use a flyout or dialog for interactive floating content.
|
|
56
|
+
|
|
57
|
+
Tooltips are supplemental, non-interactive content. Use an explicit tooltip element when local inherited styling context matters; generated shorthand content may be created outside that local context.
|
|
58
|
+
|
|
59
|
+
Do not override positioning owned by the runtime.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Forms
|
|
2
|
+
|
|
3
|
+
## Native semantics first
|
|
4
|
+
|
|
5
|
+
Actual CSS styles and progressively enhances native controls. Domain policy remains application/server responsibility.
|
|
6
|
+
|
|
7
|
+
Use documented form structure instead of recreating field spacing, helper/error layout, and invalid-state styling around anonymous wrappers.
|
|
8
|
+
|
|
9
|
+
## Keyboard intent vs filtering
|
|
10
|
+
|
|
11
|
+
`inputmode` changes keyboard intent; it does not constrain the value.
|
|
12
|
+
|
|
13
|
+
`data-filter` explicitly rewrites input and is therefore a stronger policy. Empty `data-filter` does nothing and should not infer behavior from `inputmode`.
|
|
14
|
+
|
|
15
|
+
Use application code for locale-specific numeric rules, currency rules, signed input, ranges, or other domain-specific policies.
|
|
16
|
+
|
|
17
|
+
## Masks
|
|
18
|
+
|
|
19
|
+
`data-mask` is for fixed shape, not semantic validity.
|
|
20
|
+
|
|
21
|
+
A value can match a shape and still be an impossible date, invalid account number, or otherwise invalid domain value.
|
|
22
|
+
|
|
23
|
+
## Telephone input
|
|
24
|
+
|
|
25
|
+
Do not mask phone numbers by default. Preserve user input and normalize/validate authoritative number semantics on the server.
|
|
26
|
+
|
|
27
|
+
If the installed Actual version exposes `tel-prefix`, treat it only as a coarse client-side origin policy, not phone-number validation.
|
|
28
|
+
|
|
29
|
+
## Validation
|
|
30
|
+
|
|
31
|
+
Native validation is the baseline. The optional validation enhancer adds state/focus behavior and a small rule system; it is not the application's validation architecture.
|
|
32
|
+
|
|
33
|
+
Typical structure:
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<form class="needs-validation" data-enhance="validation" novalidate>
|
|
37
|
+
<label class="field">
|
|
38
|
+
<span class="field-label">Email</span>
|
|
39
|
+
<input class="input" type="email" required aria-describedby="email-error">
|
|
40
|
+
<span class="field-error" id="email-error">Enter a valid email.</span>
|
|
41
|
+
</label>
|
|
42
|
+
</form>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Keep help/error text connected with `aria-describedby`; keep invalid state synchronized with `aria-invalid`.
|
|
46
|
+
|
|
47
|
+
Server-side or AJAX validation remains authoritative for business rules.
|
|
48
|
+
|
|
49
|
+
Before depending on a custom rule name or exact enhancer behavior, check the installed docs/source.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Layout and theming
|
|
2
|
+
|
|
3
|
+
## Integration order
|
|
4
|
+
|
|
5
|
+
Translate designs in this order:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
Theme -> relationship -> component -> public hook -> small utility -> application identity
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Theme first
|
|
12
|
+
|
|
13
|
+
Keep palette literals centralized in a theme/token block. Application rules should consume or derive semantic values rather than copy palette literals repeatedly.
|
|
14
|
+
|
|
15
|
+
```css
|
|
16
|
+
[data-theme="brand"] {
|
|
17
|
+
--primary: hsl(326 100% 60%);
|
|
18
|
+
--brand-glow: color-mix(in oklch, var(--primary) 40%, transparent);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.hero {
|
|
22
|
+
box-shadow: 0 0 2rem var(--brand-glow);
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Global semantic tokens are the first choice for application CSS. Component hooks are local tuning points.
|
|
27
|
+
|
|
28
|
+
## Choose layout by relationship
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
.stack vertical flow
|
|
32
|
+
.cluster wrapping inline peers / toolbar-like rows
|
|
33
|
+
.grid responsive repeated items
|
|
34
|
+
.grid-N known equal peer density
|
|
35
|
+
.switcher peer regions that switch together
|
|
36
|
+
.sidebar-layout main content plus secondary region
|
|
37
|
+
.media fixed media plus flexible content
|
|
38
|
+
.column-layout explicit shared-canvas placement
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For exact tracks that do not match a built-in contract, use `.grid` with `--grid-columns` rather than inventing a new generic grid primitive.
|
|
42
|
+
|
|
43
|
+
Do not choose `.app-layout` just because the product is an app. It is a specific viewport-sized shell with internal scrolling and adaptive navigation.
|
|
44
|
+
|
|
45
|
+
## Tune before replacing
|
|
46
|
+
|
|
47
|
+
Prefer public hooks:
|
|
48
|
+
|
|
49
|
+
```css
|
|
50
|
+
.feature-grid {
|
|
51
|
+
--grid-min: 18rem;
|
|
52
|
+
--gap: var(--space-50);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.product-card {
|
|
56
|
+
--card-pad: var(--space-50);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If local CSS mainly reconstructs an Actual primitive with `display`, tracks, gaps, focus styling, or component geometry, reconsider the primitive or its hooks first.
|
|
61
|
+
|
|
62
|
+
## `--gap` and local `gap`
|
|
63
|
+
|
|
64
|
+
`--gap` can be an inherited rhythm contract. Rebinding it may intentionally affect nested layout primitives.
|
|
65
|
+
|
|
66
|
+
If only one element's spacing should change, set the CSS `gap` property directly instead of rebinding inherited rhythm.
|
|
67
|
+
|
|
68
|
+
## Public vs internal custom properties
|
|
69
|
+
|
|
70
|
+
Use documented public hooks. Treat runtime-written, state-owned, derived, relay, and undocumented variables as internal.
|
|
71
|
+
|
|
72
|
+
A component-scoped hook does not exist everywhere. If application CSS intentionally reads one outside its component, provide a fallback:
|
|
73
|
+
|
|
74
|
+
```css
|
|
75
|
+
.panel {
|
|
76
|
+
padding: var(--card-pad, var(--space-40));
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Application CSS is expected
|
|
81
|
+
|
|
82
|
+
Good application CSS includes brand marks, illustrations, unusual geometry, bespoke animation, and product-specific compositions. The goal is not zero custom CSS; it is no duplicated framework behavior.
|