|
1 | 1 | /* |
2 | | - * Primary color as a single overridable variable: `--devframe-primary`. |
3 | | - * |
4 | | - * Appended AFTER the UnoCSS output (see `scripts/build-css.ts`) so this block |
5 | | - * wins over Wind3's own `:root, :host` primary declarations, and imported after |
6 | | - * `virtual:uno.css` in the Storybook preview for the same reason. |
| 2 | + * Primary color as a single overridable variable: `--devframe-primary`. Shared |
| 3 | + * by every devframe surface: appended after each shadow-root build's UnoCSS |
| 4 | + * output (the hub-ui dock, the json-render renderer module; see |
| 5 | + * `build-shadow-css.ts`), imported last by every built-in devframe panel SPA so |
| 6 | + * it inherits a rebranded hub's accent, and imported after `virtual:uno.css` in |
| 7 | + * the hub-ui Storybook preview. It always wins over Wind's own `:root, :host` |
| 8 | + * primary declarations because it comes last. |
7 | 9 | * |
8 | 10 | * Each stop (`--colors-primary-*`) is derived from `--devframe-primary` via |
9 | 11 | * `color-mix`. When `--devframe-primary` is unset, the intermediate |
10 | 12 | * `--devframe-primary-<stop>` vars become guaranteed-invalid (their `color-mix` |
11 | 13 | * references an unset var with no fallback), so each `--colors-primary-<stop>` |
12 | 14 | * falls back to the exact devframe default hex; the default look is preserved, |
13 | 15 | * and only an explicit override derives a new ramp. The vars inherit through |
14 | | - * the tree, so setting `--devframe-primary` on the dock host retints |
15 | | - * everything, and setting it on a group's chrome container retints just that |
16 | | - * group (the group-accent mechanism). |
| 16 | + * the tree, so setting `--devframe-primary` on a host (the dock host, a viewer |
| 17 | + * mount container, or a panel's `<html>`) retints everything below it, and |
| 18 | + * setting it on a group's chrome container retints just that group (the |
| 19 | + * group-accent mechanism). |
17 | 20 | * |
18 | | - * The dock's shadow root is built on Wind3, which bakes `primary`-based |
19 | | - * utilities (`text-primary`, `bg-primary`, `btn-primary`, `ring-primary-500`, |
20 | | - * …) to literal `rgb()` triplets rather than referencing these variables, so |
21 | | - * `scripts/build-css.ts` rewires those baked colors into CSS relative-color |
22 | | - * syntax reading `--colors-primary-<stop>` (see `rewireBakedPrimaryColors` in |
23 | | - * `design/uno.config.ts`) so this block actually retints them, not just the |
24 | | - * handful of rules (the glow gradient below) that reference the variables |
25 | | - * directly. The stops declared here (`DEFAULT`/`600`/`500`/`400`/`300`) must |
26 | | - * match `OVERRIDABLE_PRIMARY_STOPS` there. |
| 21 | + * A shadow root built on Wind3 bakes `primary`-based utilities (`text-primary`, |
| 22 | + * `bg-primary`, `btn-primary`, `ring-primary-500`, …) to literal `rgb()` |
| 23 | + * triplets rather than referencing these variables, so `build-shadow-css.ts` |
| 24 | + * rewires those baked colors into CSS relative-color syntax reading |
| 25 | + * `--colors-primary-<stop>` (see `rewireBakedPrimaryColors` in `uno.config.ts`) |
| 26 | + * so this block actually retints them, not just the handful of rules (the dock's |
| 27 | + * glow gradient) that reference the variables directly. The stops declared here |
| 28 | + * (`DEFAULT`/`600`/`500`/`400`/`300`) must match `OVERRIDABLE_PRIMARY_STOPS` |
| 29 | + * there. |
27 | 30 | * |
28 | | - * `:host` is the effective selector inside the dock's shadow root; `:root` is |
29 | | - * for the light-DOM Storybook preview (it matches nothing in the shadow root). |
| 31 | + * `:host` is the effective selector inside a shadow root; `:root` is for the |
| 32 | + * light-DOM panel SPAs and the Storybook preview (it matches nothing in a |
| 33 | + * shadow root). |
30 | 34 | * |
31 | 35 | * `.devframes-accent-scope` re-declares the whole block on a group's chrome |
32 | 36 | * container: because custom properties inherit as computed values, a descendant |
33 | 37 | * that only overrides `--devframe-primary` would keep the `:host`-computed |
34 | 38 | * stops; re-running the derivation here recomputes them from the container's |
35 | 39 | * own `--devframe-primary` (a group's `accentColor`), retinting just that group. |
| 40 | + * Inert on surfaces that never apply the class. |
36 | 41 | */ |
37 | 42 | :root, |
38 | 43 | :host, |
|
0 commit comments