actual-css 0.17.1 → 0.18.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 +39 -0
- package/README.md +7 -5
- package/components.json +20 -4
- package/dist/actual.full.css +219 -26
- package/dist/actual.full.min.css +1 -1
- package/docs/design-notes/tokens.md +2 -1
- package/docs/navigation.json +1 -0
- package/docs/pages/components/alert.md +8 -6
- package/docs/pages/components/button.md +26 -24
- package/docs/pages/components/list.md +117 -29
- package/docs/pages/components/timeline.md +130 -2
- package/docs/pages/examples/overview.md +2 -0
- package/docs/pages/foundations/theming.md +6 -4
- package/docs/pages/foundations/tokens.md +10 -9
- package/docs/pages/foundations/typography.md +5 -0
- package/docs/pages/guides/coding-agents.md +163 -0
- package/docs/pages/guides/introduction.md +1 -1
- package/docs/pages/guides/upgrading.md +1 -1
- package/docs/pages/layout/scroll-snap.md +26 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/reserved-classes.json +2 -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/timeline.css +113 -10
- package/src/css/core/tokens.css +4 -1
- package/src/css/forms/choice.css +7 -0
- package/src/tooling/design-components.js +2 -2
|
@@ -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.18/dist/actual.full.min.css">
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
The package does not maintain separate partial bundles. Modular entrypoints map
|
|
@@ -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
|
|
@@ -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.
|
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:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "actual-css",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.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",
|
package/reserved-classes.json
CHANGED
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"grid-3",
|
|
98
98
|
"grid-4",
|
|
99
99
|
"grid-6",
|
|
100
|
+
"grouped",
|
|
100
101
|
"grow",
|
|
101
102
|
"had-scrollbar",
|
|
102
103
|
"has-modal-open",
|
|
@@ -255,6 +256,7 @@
|
|
|
255
256
|
"textarea",
|
|
256
257
|
"tight",
|
|
257
258
|
"timeline",
|
|
259
|
+
"timeline-dates-end",
|
|
258
260
|
"tooltip",
|
|
259
261
|
"topbar",
|
|
260
262
|
"touch-target",
|
|
@@ -4,6 +4,8 @@ Copy this file to `PROJECT.md` beside `SKILL.md` and keep only decisions that ar
|
|
|
4
4
|
|
|
5
5
|
This file narrows **how the application uses Actual CSS**. It does not redefine Actual CSS API.
|
|
6
6
|
|
|
7
|
+
Visual direction (mood, color roles, depth, named rules) lives in `DESIGN.md` at the project root, and the shipped values live in the theme stylesheet. Keep only implementation facts here.
|
|
8
|
+
|
|
7
9
|
## Imports
|
|
8
10
|
|
|
9
11
|
CSS loaded by this project:
|
|
@@ -20,15 +22,24 @@ JavaScript enhancers loaded by this project:
|
|
|
20
22
|
|
|
21
23
|
## Theme
|
|
22
24
|
|
|
23
|
-
Theme root / selector:
|
|
25
|
+
Theme stylesheet and root / selector:
|
|
24
26
|
|
|
25
27
|
```text
|
|
26
28
|
TODO
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
Application-owned
|
|
31
|
+
Application-owned tokens derived from the theme:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
- TODO
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Design mapping
|
|
38
|
+
|
|
39
|
+
Roles named in `DESIGN.md`, expressed with Actual classes and hooks:
|
|
30
40
|
|
|
31
41
|
```text
|
|
42
|
+
- Primary action → .btn.primary
|
|
32
43
|
- TODO
|
|
33
44
|
```
|
|
34
45
|
|
|
@@ -39,8 +39,13 @@ SKILL.md + references
|
|
|
39
39
|
|
|
40
40
|
PROJECT.md
|
|
41
41
|
-> how this application chooses to use it
|
|
42
|
+
|
|
43
|
+
DESIGN.md (project root, optional)
|
|
44
|
+
-> what this application should look like, and why
|
|
42
45
|
```
|
|
43
46
|
|
|
47
|
+
`DESIGN.md` follows the [DESIGN.md format](https://github.com/google-labs-code/design.md) and is usually maintained with a design skill such as Impeccable. Actual CSS does not ship one: it has no house style to impose. See the [Coding agents and DESIGN.md](https://lekoala.github.io/actual-css/site/guides/coding-agents.html) guide.
|
|
48
|
+
|
|
44
49
|
## Why the skill does not bundle the catalog
|
|
45
50
|
|
|
46
51
|
`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.
|
|
@@ -36,6 +36,16 @@ node <skill>/scripts/inspect-actual-css.mjs --enhancements
|
|
|
36
36
|
|
|
37
37
|
If `PROJECT.md` exists beside this file, read it after resolving the Actual CSS API. It contains application-specific choices, not framework API.
|
|
38
38
|
|
|
39
|
+
## Design direction
|
|
40
|
+
|
|
41
|
+
If `DESIGN.md` (and `PRODUCT.md`) exists at the project root, read it after `PROJECT.md`. It says what the interface should look like; this skill says how to write it in Actual CSS.
|
|
42
|
+
|
|
43
|
+
- Express its roles through the class mapping in `PROJECT.md` and the decision order below. Never invent a class, variant, or hook to match its wording.
|
|
44
|
+
- `DESIGN.md` records the approved direction; the theme stylesheet defines the values actually shipped. When they disagree, neither wins by default: report the drift and ask whether the design changed on purpose or the code drifted, then update the stale document or fix the theme. Never silently copy a value either way.
|
|
45
|
+
- A product-specific requirement no token, hook, or component expresses is focused application CSS, derived from theme tokens. Report a missing hook only when the need is generic and recurring. Never override a component's internal state or behavior.
|
|
46
|
+
|
|
47
|
+
When a design skill (Impeccable or similar) is active, it owns direction, critique, and `DESIGN.md`; this skill still owns vocabulary and the completion check. Fix its findings through the decision order, confirm computed sizes and colors on the rendered page rather than from a source scan, and never copy its preview snippets (`.impeccable/design.json`) into application code.
|
|
48
|
+
|
|
39
49
|
## Decision order
|
|
40
50
|
|
|
41
51
|
Before writing application CSS, ask in this order:
|
|
@@ -204,9 +214,10 @@ Useful project-specific additions include:
|
|
|
204
214
|
- server-side component/template wrappers already available;
|
|
205
215
|
- application class naming rules;
|
|
206
216
|
- stricter browser-support requirements;
|
|
207
|
-
- product-specific composition conventions
|
|
217
|
+
- product-specific composition conventions;
|
|
218
|
+
- the mapping from `DESIGN.md` roles to Actual classes.
|
|
208
219
|
|
|
209
|
-
Start from `PROJECT.md.example`.
|
|
220
|
+
Start from `PROJECT.md.example`. Visual direction belongs in `DESIGN.md`, not here.
|
|
210
221
|
|
|
211
222
|
Project rules may narrow how Actual CSS is used, but must not invent or redefine Actual CSS public API.
|
|
212
223
|
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
* --alert-pad-block
|
|
15
15
|
* --alert-pad-inline
|
|
16
16
|
* --alert-font-size
|
|
17
|
+
* --alert-line-height
|
|
17
18
|
* --alert-radius
|
|
18
19
|
* --alert-icon-size
|
|
20
|
+
* --alert-icon-nudge
|
|
19
21
|
* --alert-border-inline-start-color
|
|
20
22
|
* --alert-border-inline-start-width
|
|
21
23
|
*
|
|
@@ -42,6 +44,7 @@
|
|
|
42
44
|
--alert-pad-block: var(--space-30);
|
|
43
45
|
--alert-pad-inline: var(--space-40);
|
|
44
46
|
--alert-font-size: var(--font-size-md);
|
|
47
|
+
--alert-line-height: var(--line-height);
|
|
45
48
|
--alert-icon-size: 1.25rem;
|
|
46
49
|
--alert-default-bg: var(--surface-subtle);
|
|
47
50
|
--alert-default-fg: var(--intent, var(--text));
|
|
@@ -59,6 +62,11 @@
|
|
|
59
62
|
border-inline-start-width: var(--alert-border-inline-start-width, var(--border-width));
|
|
60
63
|
border-radius: var(--alert-radius, var(--radius-lg));
|
|
61
64
|
font-size: var(--alert-font-size);
|
|
65
|
+
/* why: the icon offset below is derived from this line box. Inheriting the
|
|
66
|
+
leading would leave the formula blind to a container that changed it, so
|
|
67
|
+
the alert owns its line height the way it owns its font size; an author
|
|
68
|
+
changing the rhythm sets the hook, not `line-height` directly. */
|
|
69
|
+
line-height: var(--alert-line-height);
|
|
62
70
|
}
|
|
63
71
|
|
|
64
72
|
/* Density steps the block padding only: the inline padding is the text
|
|
@@ -80,7 +88,7 @@
|
|
|
80
88
|
siblings instead of a wrapper carrying an inline --gap. What made that pair
|
|
81
89
|
read as detached is the UA paragraph margin: trimming only the outer edges
|
|
82
90
|
left it in place between them. Content keeps its own internal rhythm — a
|
|
83
|
-
|
|
91
|
+
list keeps its bullets, a .prose child keeps its flow.
|
|
84
92
|
The slots are excluded because they are anatomy, not content: an
|
|
85
93
|
admonition's title bar has to stay flush against its body. The list follows
|
|
86
94
|
the anatomy, so it grows with it. */
|
|
@@ -94,6 +102,13 @@
|
|
|
94
102
|
margin-block-start: var(--space-10);
|
|
95
103
|
}
|
|
96
104
|
|
|
105
|
+
/* why: the UA indent (40px) set a list's bullets in a column of their own,
|
|
106
|
+
detached from the title above it. The bullets start on the text column's
|
|
107
|
+
edge instead, the way an error summary reads. */
|
|
108
|
+
.alert > :where(ul, ol) {
|
|
109
|
+
padding-inline-start: 1.25em;
|
|
110
|
+
}
|
|
111
|
+
|
|
97
112
|
/* Alerts are soft by default. The recipe writes local defaults rather than
|
|
98
113
|
--ui-* so an explicit shared treatment always wins without exclusions. The
|
|
99
114
|
fill is the translucent soft tint (see badge.css), with no rim unless a
|
|
@@ -186,13 +201,25 @@
|
|
|
186
201
|
icon sat in the title row alone — any icon taller than one line inflated
|
|
187
202
|
that row and pushed the body down. Spanning the title and body rows lets
|
|
188
203
|
its height spread over both; only an icon taller than both together still
|
|
189
|
-
splits its excess between them.
|
|
204
|
+
splits its excess between them. Spanning is also why the icon cannot ride
|
|
205
|
+
the text baseline (align-self: baseline): a baseline group over both
|
|
206
|
+
rows would let a tall icon set the row's baseline, inflating row 1 and
|
|
207
|
+
pushing the title down — the regression alert-anatomy.test.js guards. */
|
|
190
208
|
.alert:has(> .alert-icon) > .alert-icon {
|
|
191
209
|
grid-column: 1;
|
|
192
210
|
grid-row: 1 / span 2;
|
|
193
211
|
display: inline-grid;
|
|
194
212
|
place-items: center;
|
|
195
|
-
|
|
213
|
+
/* The line box's centre is not the cap-height centre: cap/ex cannot derive
|
|
214
|
+
an optical correction from it. Keep glyph corrections explicit.
|
|
215
|
+
--alert-font-size must stay in rem or px because em resolves against
|
|
216
|
+
the icon's own size here. The nudge also accommodates a theme tile whose
|
|
217
|
+
padding and border grow the icon box (neo-brutalist). */
|
|
218
|
+
margin-block-start: calc(
|
|
219
|
+
(var(--alert-line-height) * var(--alert-font-size) - var(--alert-icon-size)) /
|
|
220
|
+
2 +
|
|
221
|
+
var(--alert-icon-nudge, 0px)
|
|
222
|
+
);
|
|
196
223
|
}
|
|
197
224
|
|
|
198
225
|
.alert:has(> .alert-icon) > :not(.alert-icon, .close) {
|
|
@@ -210,6 +237,11 @@
|
|
|
210
237
|
.alert:has(> .close) > .close {
|
|
211
238
|
grid-column: -2 / -1;
|
|
212
239
|
grid-row: 1;
|
|
240
|
+
/* why: the button is taller than the line, so top-aligned it sat 2px below
|
|
241
|
+
the title centre, opposite an icon centred on it, and grew row 1, pushing
|
|
242
|
+
the body down. Equal negative margins centre it on the first line box and
|
|
243
|
+
let it overflow into the padding instead; the hit area is unchanged. */
|
|
244
|
+
margin-block: calc((var(--alert-line-height) * var(--alert-font-size) - var(--close-size)) / 2);
|
|
213
245
|
}
|
|
214
246
|
/* Links */
|
|
215
247
|
.alert :where(a:not(.btn)) {
|
|
@@ -261,6 +293,11 @@
|
|
|
261
293
|
border-start-end-radius: calc(var(--alert-radius, var(--radius-lg)) - var(--border-width));
|
|
262
294
|
}
|
|
263
295
|
|
|
296
|
+
/* Translate preserves the title bar's flex geometry when nudging a glyph. */
|
|
297
|
+
.alert.admonition > .alert-title > .alert-icon {
|
|
298
|
+
translate: 0 var(--alert-icon-nudge, 0px);
|
|
299
|
+
}
|
|
300
|
+
|
|
264
301
|
/* Close inside an admonition title bar rides the inline end. */
|
|
265
302
|
.alert.admonition > .alert-title > .close {
|
|
266
303
|
margin-inline-start: auto;
|
|
@@ -122,8 +122,26 @@
|
|
|
122
122
|
--ui-border: transparent;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
/*
|
|
126
|
-
|
|
125
|
+
/* A neutral outline is a quiet action, so its edge is the control edge that
|
|
126
|
+
identifies a field, not the full text ink. An explicit intent still wins
|
|
127
|
+
through --intent, and --border-control stays the theme's override point. */
|
|
128
|
+
.btn.outline {
|
|
129
|
+
--ui-border: var(--intent, var(--border-control));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* A surface button is neutral chrome, so it hovers at the .outline rate: an
|
|
133
|
+
opaque mix keeps its fill (--ui-bg, so an author override follows), and ink
|
|
134
|
+
rather than a black wash stays visible on a dark page. Without color-mix()
|
|
135
|
+
the solid overlay is the fallback. */
|
|
136
|
+
@supports (color: color-mix(in oklab, red, white)) {
|
|
137
|
+
.btn.surface {
|
|
138
|
+
--ui-hover-bg: color-mix(in oklab, var(--ui-bg) 90%, var(--intent, var(--text)));
|
|
139
|
+
--btn-hover-overlay: transparent;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Solid keeps the overlay darkening on hover. The recipes below keep their
|
|
144
|
+
fill: the soft hover is its own fill change (--soft-hover-alpha) — a second
|
|
127
145
|
overlay on top would double the fill step and drag its ink below the resting
|
|
128
146
|
contrast on every intent. Routed through a variable instead of a
|
|
129
147
|
:not(.outline, .ghost, .link) exclusion so the hover rule below only has to
|
|
@@ -151,13 +151,6 @@
|
|
|
151
151
|
|
|
152
152
|
/* Text controls paint their own inset focus outline (control.css), so a
|
|
153
153
|
.join never moves the ring to the group: button-only groups and wrapped
|
|
154
|
-
inputs alike keep per-control focus, with no :has() group treatment.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
intent still provides its own outline color — --intent is guaranteed-invalid
|
|
158
|
-
for a neutral button (the :where(.btn) boundary), so the fallback applies.
|
|
159
|
-
The second :has() covers a control nested one wrapper level deep. */
|
|
160
|
-
.join:has(> :is(.input, .textarea, .select)) > .btn.outline,
|
|
161
|
-
.join:has(> * > :is(.input, .textarea, .select)) > .btn.outline {
|
|
162
|
-
--btn-border-color: var(--intent, var(--border-control));
|
|
163
|
-
}
|
|
154
|
+
inputs alike keep per-control focus, with no :has() group treatment.
|
|
155
|
+
A neutral outline action draws the same --border-control edge as the field
|
|
156
|
+
by its own base rule, so the group needs no special case. */
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* --list-item-pad-inline
|
|
12
12
|
* --list-item-gap
|
|
13
13
|
* --list-divider
|
|
14
|
+
* --list-radius
|
|
14
15
|
*/
|
|
15
16
|
.list {
|
|
16
17
|
--list-item-min-size: var(--control-size-lg);
|
|
@@ -32,6 +33,37 @@
|
|
|
32
33
|
margin: 0;
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
/*
|
|
37
|
+
* Grouped — the list owns a raised surface for rows that stand alone: a
|
|
38
|
+
* settings group, a member list, an active-sessions panel. A bare list (the
|
|
39
|
+
* default) leaves the surface to its container, so the shell is opt-in.
|
|
40
|
+
*
|
|
41
|
+
* The shell replaces the leading divider with its own border. It is not a
|
|
42
|
+
* scroll container: a row flyout must be able to escape it. The first and last
|
|
43
|
+
* rows carry the matching corner radius directly instead, which keeps a hover
|
|
44
|
+
* or current fill inside the shell without clipping the panel.
|
|
45
|
+
*/
|
|
46
|
+
.list.grouped {
|
|
47
|
+
--list-item-pad-inline: var(--space-40);
|
|
48
|
+
--list-radius: var(--radius-lg);
|
|
49
|
+
|
|
50
|
+
border: var(--border-width) solid var(--border);
|
|
51
|
+
border-radius: var(--list-radius);
|
|
52
|
+
background: var(--surface-raised);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* A row's fill sits inside the shell's border box, so its inner radius is the
|
|
56
|
+
shell radius minus that border — and never negative on a square theme. */
|
|
57
|
+
.list.grouped > :where(li:first-child > .list-item, .list-item:first-child) {
|
|
58
|
+
border-start-start-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
|
|
59
|
+
border-start-end-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.list.grouped > :where(li:last-child > .list-item, .list-item:last-child) {
|
|
63
|
+
border-end-start-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
|
|
64
|
+
border-end-end-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
|
|
65
|
+
}
|
|
66
|
+
|
|
35
67
|
/*
|
|
36
68
|
* Flex, not a three-track grid: the leading and trailing regions are optional,
|
|
37
69
|
* and a fixed `auto minmax(0, 1fr) auto` template gives an absent region a
|