actual-css 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/actual.full.css +17 -1
- package/dist/actual.full.min.css +1 -1
- package/docs/design-notes/architecture.md +3 -0
- package/docs/design-notes/enhancement-contract.md +14 -0
- package/docs/design-notes/naming.md +6 -0
- package/docs/design-notes/steps.md +13 -2
- package/docs/design-notes/tokens.md +159 -0
- package/docs/pages/components/button.md +27 -7
- package/docs/pages/components/card.md +6 -7
- package/docs/pages/components/steps.md +30 -16
- package/docs/pages/enhancements/overview.md +13 -20
- package/docs/pages/enhancements/status-bar.md +7 -9
- package/docs/pages/enhancements/tabs.md +11 -15
- package/docs/pages/enhancements/tooltip.md +10 -19
- package/docs/pages/forms/joined-controls.md +4 -2
- package/docs/pages/foundations/philosophy.md +26 -62
- package/docs/pages/foundations/theming.md +21 -36
- package/docs/pages/foundations/tokens.md +91 -159
- package/docs/pages/guides/integrating-actual-css.md +1 -1
- package/docs/pages/guides/introduction.md +13 -13
- package/docs/pages/layout/choosing.md +10 -16
- package/docs/pages/layout/grid.md +8 -16
- package/docs/pages/patterns/intent-nesting.md +13 -1
- package/package.json +1 -1
- package/src/css/components/app-nav.css +2 -0
- package/src/css/core/base.css +10 -1
- package/src/css/core/reset.css +5 -0
|
@@ -108,7 +108,7 @@ Prefer:
|
|
|
108
108
|
`<div class="cluster product-actions">`. The hook is read by `.cluster`, so the
|
|
109
109
|
CSS stays a local adjustment, not a reimplementation.
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
Avoid reimplementing a primitive's layout:
|
|
112
112
|
|
|
113
113
|
```css
|
|
114
114
|
/* Avoid when an Actual primitive already owns this behavior */
|
|
@@ -19,11 +19,10 @@ cascade layers, import order, or a project-owned build-time prefix transform.
|
|
|
19
19
|
- Markup stays understandable without JavaScript, and modern features are gated
|
|
20
20
|
with `@supports` so older browsers keep the core layout and controls.
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
layers and the order to follow before adding CSS.
|
|
22
|
+
Use classes for presentation, HTML and ARIA for meaning and state,
|
|
23
|
+
`data-enhance` to enable behavior, and feature-specific `data-*` attributes to
|
|
24
|
+
configure it. See [Philosophy](../foundations/philosophy.md) for the main
|
|
25
|
+
principles and how to compose components.
|
|
27
26
|
|
|
28
27
|
## Install
|
|
29
28
|
|
|
@@ -67,14 +66,15 @@ Actual CSS uses a small unprefixed class grammar:
|
|
|
67
66
|
.component [intent] [variant] [size] [modifier]
|
|
68
67
|
```
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
- **Intent:** `.primary`, `.secondary`, `.success`, `.warning`, or `.danger`.
|
|
70
|
+
- **Variant:** `.solid`, `.soft`, `.outline`, or `.surface`. Buttons also
|
|
71
|
+
support `.ghost` and `.link`.
|
|
72
|
+
- **Size:** `.sm` or `.lg` changes text and geometry on supported components.
|
|
73
|
+
- **Density:** `.compact` or `.spacious` changes spacing and geometry across a
|
|
74
|
+
region, keeping text and icons at the same size.
|
|
75
|
+
|
|
76
|
+
Use `data-theme` to give a region a different palette. Undocumented `is-*`
|
|
77
|
+
classes belong to the runtime.
|
|
78
78
|
|
|
79
79
|
```html
|
|
80
80
|
<button class="btn">Click me</button>
|
|
@@ -10,15 +10,13 @@ number of children visible in one mockup.
|
|
|
10
10
|
| A normally scrolling page | Semantic landmarks, optionally `.app-shell` |
|
|
11
11
|
| Topbar + scrolling main + adaptive nav | `.app-layout` |
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
where the primary navigation moves from bottom to side.
|
|
13
|
+
For public, marketing, and editorial pages, use semantic landmarks and add
|
|
14
|
+
`.navbar` for site navigation.
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
below.
|
|
16
|
+
Use `.app-layout` for a viewport-sized shell where the main region scrolls
|
|
17
|
+
independently and navigation moves from bottom to side. Follow its
|
|
18
|
+
[required structure](app-layout.md). For other arrangements, compose the
|
|
19
|
+
primitives below.
|
|
22
20
|
|
|
23
21
|
## Content relationships
|
|
24
22
|
|
|
@@ -39,14 +37,10 @@ all peers should move together rather than form a partial row, use `.switcher`.
|
|
|
39
37
|
|
|
40
38
|
For a main region plus an aside, use `.sidebar-layout`.
|
|
41
39
|
|
|
42
|
-
Use `.column-layout`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
primitive with no automatic responsive behavior: the canvas stays twelve
|
|
47
|
-
columns and the application owns narrow-container recomposition. Choose it
|
|
48
|
-
because placement is the design, not because a mockup happens to contain
|
|
49
|
-
columns.
|
|
40
|
+
Use `.column-layout` for deliberate placement on a shared 12-column canvas:
|
|
41
|
+
an inset article, aligned sections, or an editorial composition. It keeps
|
|
42
|
+
twelve columns at every width; add application CSS to rearrange it in narrow
|
|
43
|
+
containers.
|
|
50
44
|
|
|
51
45
|
Use `--grid-columns` for exact track templates that do not match a built-in
|
|
52
46
|
layout contract: arbitrary structural counts such as seven calendar days,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Grid
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
column count.
|
|
3
|
+
Choose what determines the column count:
|
|
5
4
|
|
|
6
5
|
- The **item width** is what matters — use `.grid` and tune `--grid-min`.
|
|
7
6
|
- The **column density** is what matters — use `.grid-2`, `.grid-3`, `.grid-4`,
|
|
@@ -30,9 +29,8 @@ Tune the item minimum with `--grid-min`.
|
|
|
30
29
|
|
|
31
30
|
## Count-driven density
|
|
32
31
|
|
|
33
|
-
`.grid-N`
|
|
34
|
-
|
|
35
|
-
width.
|
|
32
|
+
`.grid-N` fits up to N equal-width columns and reduces the count as space
|
|
33
|
+
narrows. It is responsive without a container wrapper.
|
|
36
34
|
|
|
37
35
|
```html demo resize
|
|
38
36
|
<div class="grid-4">
|
|
@@ -43,8 +41,7 @@ width.
|
|
|
43
41
|
</div>
|
|
44
42
|
```
|
|
45
43
|
|
|
46
|
-
`--grid-min`
|
|
47
|
-
density is `.grid-N`'s. Choose the preset that suits your item size:
|
|
44
|
+
`--grid-min` applies only to `.grid`. Choose a preset that suits your item size:
|
|
48
45
|
|
|
49
46
|
| Item | Preset |
|
|
50
47
|
| --------------------------------- | -------------------- |
|
|
@@ -111,15 +108,10 @@ that width **plus its own padding and borders**:
|
|
|
111
108
|
Round up past the figure rather than matching it exactly, so a later padding
|
|
112
109
|
change cannot drop the region a state.
|
|
113
110
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
to that name, never to an incidental query container, so a region that sets
|
|
119
|
-
`container-type: inline-size` for its own reasons leaves the grid untouched. The container has to be an
|
|
120
|
-
ancestor: an element cannot query its own size without taking inline-size
|
|
121
|
-
containment, which would collapse the grid inside a `.cluster`, a float, or any
|
|
122
|
-
shrink-to-fit box. Put it on a normal block-level wrapper for the same reason.
|
|
111
|
+
Use a normal block-level ancestor as the named container, keeping it separate
|
|
112
|
+
from the grid. Only the name `actual-container` enables balanced subdivision;
|
|
113
|
+
an unnamed query container leaves the baseline behavior unchanged. The same
|
|
114
|
+
named container can serve both a grid and a step flow.
|
|
123
115
|
|
|
124
116
|
The chain balances the **declared density**, not your actual item count. Eight
|
|
125
117
|
items in `.grid-6` still give `6 + 2`. For a paginated collection, choose a page
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
# Intent Nesting
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An intent applies to the component carrying it. Nested components keep their
|
|
4
|
+
own default intent unless you give them one:
|
|
5
|
+
|
|
6
|
+
```html
|
|
7
|
+
<div class="alert danger">
|
|
8
|
+
Something went wrong.
|
|
9
|
+
<button class="btn" type="button">Dismiss</button>
|
|
10
|
+
<button class="btn primary" type="button">Retry</button>
|
|
11
|
+
</div>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The alert uses danger colors, Dismiss stays neutral, and Retry uses primary.
|
|
15
|
+
Set an intent on each component that needs it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "actual-css",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
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.3",
|
|
@@ -57,6 +57,8 @@
|
|
|
57
57
|
text-align: center;
|
|
58
58
|
text-decoration: none;
|
|
59
59
|
overflow-wrap: anywhere;
|
|
60
|
+
/* A rounded tile: opt out of the bare-link tap flash from base.css. */
|
|
61
|
+
-webkit-tap-highlight-color: transparent;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
.app-nav > a > :where(svg, img, [aria-hidden="true"]) {
|
package/src/css/core/base.css
CHANGED
|
@@ -26,10 +26,19 @@ a {
|
|
|
26
26
|
text-underline-offset: 0.18em;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
/* :active stands in for the native tap highlight the reset removes. */
|
|
30
|
+
a:is(:hover, :active) {
|
|
30
31
|
text-decoration-thickness: 0.12em;
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
/* Bare text links get back the tap flash the reset removes: a text link has
|
|
35
|
+
no pressed state of its own. Tinted from the link ink so it reads on any
|
|
36
|
+
surface. Zero specificity so a component styling classless anchors (an
|
|
37
|
+
.app-nav tile) can opt out with transparent. */
|
|
38
|
+
:where(a[href]:not([class])) {
|
|
39
|
+
-webkit-tap-highlight-color: color-mix(in oklab, currentColor 18%, transparent);
|
|
40
|
+
}
|
|
41
|
+
|
|
33
42
|
/* Global heading chrome: color (--heading or inherit), a tight line-height,
|
|
34
43
|
and progressive text-wrap. No font-size or font-weight is set globally —
|
|
35
44
|
components and .prose own the per-context scale. */
|
package/src/css/core/reset.css
CHANGED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
html {
|
|
9
9
|
-webkit-text-size-adjust: 100%;
|
|
10
|
+
/* The native tap highlight is a rectangle that ignores border-radius and
|
|
11
|
+
custom surfaces; components use their own interaction states where
|
|
12
|
+
relevant. Inherited, so one declaration covers every element; base.css
|
|
13
|
+
restores a tinted flash on bare text links. */
|
|
14
|
+
-webkit-tap-highlight-color: transparent;
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
body {
|