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.
@@ -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
- over reimplementing their layout:
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
- The distinction is structural, not stylistic: presentation lives in classes,
23
- JavaScript behavior opts in through `data-enhance` tokens, semantics come from
24
- ARIA and native HTML, and per-widget configuration uses self-describing
25
- `data-*` attributes. [Philosophy](../foundations/philosophy.md) lays out the
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
- Intents are `.primary`, `.secondary`, `.success`, `.warning`, and `.danger`, and
71
- work across components. Variants such as `.solid`, `.soft`, `.outline`, and `.surface` are
72
- shared by buttons, badges, alerts, and cards; a subtree that needs another
73
- palette is a `data-theme` island, not a class. `.ghost` and `.link` are
74
- button-only. Size variants `.sm` and `.lg` scale typography and
75
- participating component geometry consistently. Density contexts `.compact` and
76
- `.spacious` change geometry and spacing without changing font size, font width
77
- or icons. Undocumented `is-*` classes are runtime internals.
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
- The first covers public, marketing and editorial pages; add `.navbar` for site
14
- navigation. The second is `.app-layout` with its exact direct-child contract,
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
- Do not choose `.app-layout` from the word "app" or from the presence of a
18
- header. Its viewport-sized grid, hidden shell overflow, internal main scroll,
19
- and adaptive `.app-nav` are one indivisible behavior. If any of those is not
20
- wanted, compose the ordinary page from semantic landmarks and the primitives
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` when the placement of each region is itself part of the
43
- design — a 10-column article starting on column 2, regions in separate sibling
44
- sections that must share the same column lines, an editorial composition whose
45
- starts and spans are deliberately aligned across the page. It is the one layout
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
- Two contracts sit behind these classes. Pick by asking what determines the
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` declares a structural density of N columns. It is responsive on its
34
- own: it never exceeds N columns, never overflows, and every item keeps the same
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` does not apply here. Item width is `.grid`'s contract; column
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
- Balanced subdivision is precision, never a prerequisite for responsive
115
- behavior — forgetting the container costs you the exact chain, nothing else.
116
- `actual-container` is the framework's shared name for size-aware components,
117
- so one region can serve a grid and a step flow at once. The grid responds only
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
- Intent on an ancestor must not tint nested components, and a local intent inside an intent-carrying ancestor must win. Both directions are verified in `tests/css-audit.test.js`, `tests/browser/intent-boundary.test.js`, `tests/browser/soft-boundary.test.js` and the kitchen-sink demo template. Intent classes expose `--intent`, `--intent-fg`, and the soft-foreground relay `--intent-soft-fg`; each consuming component opens a local intent boundary in a `:where()` block that resets exactly the tokens it consumes to initial. Parent intents do not leak into nested components, and a local intent class still wins because it has higher specificity than `:where()`.
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.0",
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"]) {
@@ -26,10 +26,19 @@ a {
26
26
  text-underline-offset: 0.18em;
27
27
  }
28
28
 
29
- a:hover {
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. */
@@ -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 {