actual-css 0.17.0 → 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 +76 -0
- package/README.md +7 -5
- package/components.json +20 -4
- package/dist/actual.full.css +301 -48
- package/dist/actual.full.min.css +1 -1
- package/docs/design-notes/tokens.md +2 -1
- package/docs/navigation.json +4 -2
- package/docs/pages/components/accordion.md +8 -0
- package/docs/pages/components/alert.md +15 -11
- package/docs/pages/components/app-navigation.md +2 -2
- package/docs/pages/components/aura.md +2 -2
- package/docs/pages/components/badge.md +4 -3
- package/docs/pages/components/button.md +26 -24
- package/docs/pages/components/card.md +1 -1
- package/docs/pages/components/chat.md +2 -2
- package/docs/pages/components/fab.md +2 -1
- package/docs/pages/components/list.md +118 -30
- package/docs/pages/components/meter.md +1 -1
- package/docs/pages/components/navbar.md +1 -1
- package/docs/pages/components/overview.md +17 -0
- package/docs/pages/components/shimmer.md +2 -2
- package/docs/pages/components/timeline.md +130 -2
- package/docs/pages/enhancements/overview.md +2 -2
- package/docs/pages/enhancements/status-bar.md +1 -1
- package/docs/pages/examples/overview.md +2 -0
- package/docs/pages/forms/ajax.md +1 -1
- package/docs/pages/forms/choice-cards.md +1 -1
- package/docs/pages/forms/detached-actions.md +1 -1
- package/docs/pages/forms/floating-field.md +5 -3
- package/docs/pages/forms/form-actions.md +1 -1
- package/docs/pages/forms/input-policy.md +1 -1
- package/docs/pages/forms/joined-controls.md +1 -1
- package/docs/pages/forms/otp.md +2 -2
- package/docs/pages/forms/password.md +1 -1
- package/docs/pages/forms/states-and-sizes.md +1 -1
- package/docs/pages/forms/sticky-actions.md +1 -1
- package/docs/pages/forms/unsaved-changes.md +1 -1
- package/docs/pages/foundations/theming.md +8 -6
- package/docs/pages/foundations/tokens.md +33 -7
- package/docs/pages/foundations/typography.md +6 -1
- package/docs/pages/guides/coding-agents.md +163 -0
- package/docs/pages/guides/introduction.md +1 -1
- package/docs/pages/guides/progressive-enhancement.md +1 -1
- package/docs/pages/guides/upgrading.md +1 -1
- package/docs/pages/layout/app-layout.md +1 -1
- package/docs/pages/layout/app-shell.md +1 -1
- package/docs/pages/layout/column-layout.md +1 -1
- package/docs/pages/layout/media.md +1 -1
- package/docs/pages/layout/overview.md +1 -1
- package/docs/pages/layout/scroll-snap.md +27 -2
- package/docs/pages/layout/scroll-target.md +1 -1
- package/docs/pages/layout/sidebar-layout.md +1 -1
- package/docs/pages/layout/sidebar-shell.md +1 -1
- package/docs/pages/patterns/code-block.md +1 -1
- package/docs/pages/patterns/exclusive-accordion.md +1 -1
- package/docs/pages/patterns/hierarchical-nav.md +1 -1
- package/docs/pages/patterns/icon-input.md +1 -1
- package/docs/pages/patterns/intent-nesting.md +1 -1
- package/docs/pages/patterns/navigation-list.md +2 -2
- package/docs/pages/patterns/overview.md +1 -1
- package/docs/pages/patterns/structured-lists.md +1 -1
- package/docs/pages/utilities/flex.md +1 -1
- package/docs/pages/utilities/links.md +1 -1
- package/docs/pages/utilities/list.md +1 -1
- package/docs/pages/utilities/shape.md +1 -1
- package/docs/pages/utilities/sizing-wrapping.md +1 -1
- package/docs/pages/utilities/spacing.md +1 -1
- package/docs/pages/utilities/text.md +1 -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/cli/actual-css.js +4 -4
- package/src/css/components/accordion.css +10 -6
- package/src/css/components/alert.css +44 -3
- package/src/css/components/button.css +20 -2
- package/src/css/components/join.css +17 -10
- package/src/css/components/list.css +32 -0
- package/src/css/components/navbar.css +9 -6
- package/src/css/components/timeline.css +113 -10
- package/src/css/core/theme.css +20 -1
- package/src/css/core/tokens.css +8 -2
- package/src/css/forms/choice.css +7 -0
- package/src/css/forms/custom-select.css +10 -5
- package/src/css/forms/input-icon.css +5 -3
- package/src/css/typography/prose.css +6 -0
- package/src/tooling/design-components.js +2 -2
- package/src/tooling/design-tokens.js +1 -0
- package/src/tooling/theme-contrast.js +41 -2
- package/tokens.json +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Layout
|
|
1
|
+
# Layout overview
|
|
2
2
|
|
|
3
3
|
Layout provides a small set of composable building blocks for common page, app, and content structure. It is not a utility-first framework, and the twelve-column canvas it does ship (`.column-layout`) is an opt-in vocabulary for deliberate composition rather than the default way to build a page.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Scroll
|
|
1
|
+
# Scroll snap
|
|
2
2
|
|
|
3
3
|
Horizontal rails that stay useful without JavaScript and snap in modern browsers.
|
|
4
4
|
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
# Navigation
|
|
1
|
+
# Navigation list
|
|
2
2
|
|
|
3
3
|
Use `.nav-list` for a vertical list of navigation links: it removes native list
|
|
4
4
|
chrome, stacks the rows and stretches each `.nav-link` across the row. For a
|
|
@@ -89,7 +89,7 @@ A project may add `.site-header` when it needs a visual shell.
|
|
|
89
89
|
}
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
### App
|
|
92
|
+
### App shell with sidebar
|
|
93
93
|
|
|
94
94
|
A persistent sidebar beside the content — a dashboard, an admin panel — is
|
|
95
95
|
[`.sidebar-shell`](../layout/sidebar-shell.md): side by side from `64rem`, each
|
|
@@ -17,7 +17,7 @@ Use patterns when a semantic element needs a small amount of normalization befor
|
|
|
17
17
|
- Avoid broad element selectors such as `nav ul` or `.alert menu`.
|
|
18
18
|
- A pattern should be useful in more than one component or context.
|
|
19
19
|
|
|
20
|
-
## Relationship
|
|
20
|
+
## Relationship with layout
|
|
21
21
|
|
|
22
22
|
Patterns often compose with layout primitives.
|
|
23
23
|
|
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
|
|
package/src/cli/actual-css.js
CHANGED
|
@@ -27,10 +27,10 @@ function usage() {
|
|
|
27
27
|
"Penpot plugin that builds them. Needs Bun (bunx --bun actual-css design ...).",
|
|
28
28
|
"",
|
|
29
29
|
"contrast: measure the pairs a theme tunes by hand in headless Chrome, in every",
|
|
30
|
-
"scheme it declares: soft ink on its resting and hovered fill, the
|
|
31
|
-
"
|
|
32
|
-
"text. Exits 1 when a pair misses
|
|
33
|
-
"contrast ...).",
|
|
30
|
+
"scheme it declares: soft ink on its resting and hovered fill, the resting edge",
|
|
31
|
+
"of a field, checkbox and radio, the focus line on --surface and --surface-solid,",
|
|
32
|
+
"the invalid-field focus line, and the inverse text. Exits 1 when a pair misses",
|
|
33
|
+
"its threshold. Needs Bun (bunx --bun actual-css contrast ...).",
|
|
34
34
|
].join("\n");
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -104,12 +104,6 @@
|
|
|
104
104
|
margin-block-start: 0;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
.accordion details > summary + ul,
|
|
108
|
-
.accordion details > summary + ol {
|
|
109
|
-
margin: 0;
|
|
110
|
-
padding-inline-start: 2rem;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
107
|
/* Flush — the shell is dropped and only the shared item separators remain.
|
|
114
108
|
Zero inline padding puts the group edge to edge inside the surface that
|
|
115
109
|
already frames it, so no override is repeated per embedding. */
|
|
@@ -130,6 +124,16 @@
|
|
|
130
124
|
--surface-pad: 0px;
|
|
131
125
|
}
|
|
132
126
|
|
|
127
|
+
/* A list panel keeps its marker gutter in every treatment. The .flush
|
|
128
|
+
selector is required, not redundant: .flush zeroes the panel's inline
|
|
129
|
+
padding at higher specificity, which would push the bullets out of the
|
|
130
|
+
panel. */
|
|
131
|
+
.accordion details > summary + :is(ul, ol),
|
|
132
|
+
.accordion.flush details > summary + :is(ul, ol) {
|
|
133
|
+
margin: 0;
|
|
134
|
+
padding-inline-start: 2rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
133
137
|
/* Separated — each item owns a full card. The item's own border beats the
|
|
134
138
|
shared details + details separator on specificity alone, so nothing needs
|
|
135
139
|
undoing for the second item onwards. */
|
|
@@ -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)) {
|
|
@@ -231,6 +263,10 @@
|
|
|
231
263
|
border: 0;
|
|
232
264
|
border-inline-start: var(--alert-border-inline-start-width, 4px) solid
|
|
233
265
|
var(--alert-border-inline-start-color, var(--intent, var(--neutral)));
|
|
266
|
+
/* why: a thick flag under the large radius curves into a crescent. The
|
|
267
|
+
leading corners take the small radius so the flag stays a straight bar. */
|
|
268
|
+
border-start-start-radius: var(--radius-sm);
|
|
269
|
+
border-end-start-radius: var(--radius-sm);
|
|
234
270
|
}
|
|
235
271
|
|
|
236
272
|
/* Admonition — structured static box with a tinted title bar and a body
|
|
@@ -257,6 +293,11 @@
|
|
|
257
293
|
border-start-end-radius: calc(var(--alert-radius, var(--radius-lg)) - var(--border-width));
|
|
258
294
|
}
|
|
259
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
|
+
|
|
260
301
|
/* Close inside an admonition title bar rides the inline end. */
|
|
261
302
|
.alert.admonition > .alert-title > .close {
|
|
262
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
|
|
@@ -98,6 +98,20 @@
|
|
|
98
98
|
margin-inline-start: calc(var(--border-width) * -1);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/* Seam between adjacent filled buttons (default, .solid, .soft): their border
|
|
102
|
+
is transparent, so "Left Middle Right" read as one button. A quarter of the
|
|
103
|
+
ink turns that edge into a hairline; the mix keeps a soft rim set by
|
|
104
|
+
--soft-border-mix. Variants that already draw an edge, or have no fill, keep
|
|
105
|
+
their border untouched. Chained :not(): a list inside :not() is above
|
|
106
|
+
the Firefox 78 floor. */
|
|
107
|
+
.join > .btn + .btn:not(.outline):not(.surface):not(.ghost):not(.link) {
|
|
108
|
+
border-inline-start-color: color-mix(
|
|
109
|
+
in oklab,
|
|
110
|
+
var(--btn-border-color, var(--btn-border)),
|
|
111
|
+
var(--btn-fg) 25%
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
101
115
|
.join > :is(:hover, :focus, :focus-within) {
|
|
102
116
|
z-index: 1;
|
|
103
117
|
}
|
|
@@ -137,13 +151,6 @@
|
|
|
137
151
|
|
|
138
152
|
/* Text controls paint their own inset focus outline (control.css), so a
|
|
139
153
|
.join never moves the ring to the group: button-only groups and wrapped
|
|
140
|
-
inputs alike keep per-control focus, with no :has() group treatment.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
intent still provides its own outline color — --intent is guaranteed-invalid
|
|
144
|
-
for a neutral button (the :where(.btn) boundary), so the fallback applies.
|
|
145
|
-
The second :has() covers a control nested one wrapper level deep. */
|
|
146
|
-
.join:has(> :is(.input, .textarea, .select)) > .btn.outline,
|
|
147
|
-
.join:has(> * > :is(.input, .textarea, .select)) > .btn.outline {
|
|
148
|
-
--btn-border-color: var(--intent, var(--border-control));
|
|
149
|
-
}
|
|
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
|
|
@@ -100,20 +100,23 @@
|
|
|
100
100
|
color: var(--nav-current-fg, var(--text));
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
/* Fills are a tint of the link's own ink, the .btn.ghost hover
|
|
103
|
+
/* Fills are a tint of the link's own ink, like the .btn.ghost hover, so they
|
|
104
104
|
read on light and dark bars alike, including a bar with its own
|
|
105
105
|
--ui-bg/--ui-fg. Not --ui-hover-bg: that is the bar's own hover and can
|
|
106
|
-
equal its fill. Current is a step above hover (
|
|
107
|
-
link stays apart while another is hovered.
|
|
108
|
-
|
|
106
|
+
equal its fill. Current is a step above hover (8% vs 5%), so the current
|
|
107
|
+
link stays apart while another is hovered. Both stay paler than the ghost
|
|
108
|
+
button: a nav row is wide, and at 18% a full-width current row read as a
|
|
109
|
+
pressed button. The fill only seconds the ink step, so it needs no 3:1 of
|
|
110
|
+
its own. The baseline above keeps a light chip where color-mix is
|
|
111
|
+
missing. */
|
|
109
112
|
@supports (color: color-mix(in oklch, red, white)) {
|
|
110
113
|
.nav-link:hover {
|
|
111
|
-
background: color-mix(in oklch, currentColor
|
|
114
|
+
background: color-mix(in oklch, currentColor 5%, transparent);
|
|
112
115
|
color: var(--ui-fg, var(--text));
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
.nav-link:is([aria-current="page"], [aria-current="location"], [aria-current="true"]) {
|
|
116
|
-
background: var(--nav-current-bg, color-mix(in oklch, currentColor
|
|
119
|
+
background: var(--nav-current-bg, color-mix(in oklch, currentColor 8%, transparent));
|
|
117
120
|
color: var(--nav-current-fg, var(--ui-fg, var(--text)));
|
|
118
121
|
}
|
|
119
122
|
}
|