ui-style-kit-css 2.3.0 → 2.4.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 +57 -2
- package/CONTRIBUTING.md +8 -1
- package/README.md +102 -44
- package/STYLE-MAP.md +14 -5
- package/dist/assets/bauhaus-barlow-OFL.txt +93 -0
- package/dist/assets/bauhaus-barlow-semibold.ttf +0 -0
- package/dist/assets/bauhaus-barlow.ttf +0 -0
- package/dist/assets/bauhaus-condensed-OFL.txt +93 -0
- package/dist/assets/bauhaus-condensed-bold.ttf +0 -0
- package/dist/assets/bauhaus-condensed-extrabold.ttf +0 -0
- package/dist/assets/bento-manrope-OFL.txt +93 -0
- package/dist/assets/bento-manrope.ttf +0 -0
- package/dist/assets/clay-grain.png +0 -0
- package/dist/assets/clay-rounded-OFL.txt +93 -0
- package/dist/assets/clay-rounded.ttf +0 -0
- package/dist/assets/neo-noir-corner-dark.png +0 -0
- package/dist/assets/neo-noir-corner-light.png +0 -0
- package/dist/assets/neo-noir-texture-dark.png +0 -0
- package/dist/assets/neo-noir-texture-light.png +0 -0
- package/dist/assets/organic-display-OFL.txt +93 -0
- package/dist/assets/organic-display.ttf +0 -0
- package/dist/assets/organic-icons-LICENSE.txt +21 -0
- package/dist/assets/organic-sans-OFL.txt +93 -0
- package/dist/assets/organic-sans.ttf +0 -0
- package/dist/ui-style-kit.css +47898 -15121
- package/dist/ui-style-kit.min.css +2 -2
- package/dist/ui-style-kit.visual.css +47771 -15122
- package/dist/ui-style-kit.visual.min.css +2 -2
- package/dist/ui-style-kit.with-bridge.css +47932 -15145
- package/dist/ui-style-kit.with-bridge.min.css +2 -2
- package/dist/visual/art-deco.css +3247 -295
- package/dist/visual/bauhaus.css +2 -4692
- package/dist/visual/bento.css +2 -4708
- package/dist/visual/brutalism.css +1229 -231
- package/dist/visual/clay.css +2 -4786
- package/dist/visual/cyberpunk.css +2663 -282
- package/dist/visual/data-terminal.css +2064 -276
- package/dist/visual/editorial-luxe.css +2315 -259
- package/dist/visual/industrial-utility.css +3142 -270
- package/dist/visual/maximalist.css +2185 -454
- package/dist/visual/minimal-saas.css +1503 -398
- package/dist/visual/neo-noir.css +2 -4787
- package/dist/visual/neumorphism.css +1690 -402
- package/dist/visual/organic-modern.css +2 -4764
- package/dist/visual/paper-editorial.css +2977 -292
- package/dist/visual/retro-glass.css +2625 -299
- package/dist/visual/retrofuturism.css +1885 -397
- package/dist/visual/tactile.css +2716 -498
- package/dist/visual/technical-blueprint.css +2599 -267
- package/dist/visual/y2k.css +1906 -309
- package/docs/ART-DECO.md +80 -0
- package/docs/BAUHAUS.md +152 -0
- package/docs/BENTO.md +121 -0
- package/docs/CLAY.md +127 -0
- package/docs/COLOR-THEMES.md +63 -0
- package/docs/DEMO-SHOWCASE.md +65 -0
- package/docs/ECOSYSTEM.md +4 -4
- package/docs/EDITORIAL-LUX.md +75 -0
- package/docs/INDUSTRIAL-UTILITY.md +131 -0
- package/docs/NATIVE-ELEMENTS.md +23 -17
- package/docs/NEO-NOIR.md +94 -0
- package/docs/ORGANIC-MODERN.md +91 -0
- package/docs/PAPER-EDITORIAL.md +63 -0
- package/docs/PUBLISHING.md +31 -10
- package/docs/RELEASE-2.4.0.md +88 -0
- package/docs/RELEASE-2.4.1.md +35 -0
- package/docs/RETRO-GLASS.md +105 -0
- package/docs/STYLE-GUIDE.md +41 -26
- package/docs/TACTILE.md +38 -0
- package/docs/TECHNICAL-BLUEPRINT.md +60 -0
- package/docs/TOKENS.md +80 -3
- package/docs/superpowers/plans/2026-09-04-library-wide-theme-fallback-and-fidelity.md +331 -0
- package/docs/superpowers/specs/2026-09-04-library-wide-theme-fallback-and-fidelity-design.md +113 -0
- package/manifest.json +624 -28
- package/package.json +20 -11
- package/styles/art-deco.css +1402 -17
- package/styles/assets/bauhaus-barlow-OFL.txt +93 -0
- package/styles/assets/bauhaus-barlow-semibold.ttf +0 -0
- package/styles/assets/bauhaus-barlow.ttf +0 -0
- package/styles/assets/bauhaus-condensed-OFL.txt +93 -0
- package/styles/assets/bauhaus-condensed-bold.ttf +0 -0
- package/styles/assets/bauhaus-condensed-extrabold.ttf +0 -0
- package/styles/assets/bento-manrope-OFL.txt +93 -0
- package/styles/assets/bento-manrope.ttf +0 -0
- package/styles/assets/clay-grain.png +0 -0
- package/styles/assets/clay-rounded-OFL.txt +93 -0
- package/styles/assets/clay-rounded.ttf +0 -0
- package/styles/assets/neo-noir-corner-dark.png +0 -0
- package/styles/assets/neo-noir-corner-light.png +0 -0
- package/styles/assets/neo-noir-texture-dark.png +0 -0
- package/styles/assets/neo-noir-texture-light.png +0 -0
- package/styles/assets/organic-display-OFL.txt +93 -0
- package/styles/assets/organic-display.ttf +0 -0
- package/styles/assets/organic-icons-LICENSE.txt +21 -0
- package/styles/assets/organic-sans-OFL.txt +93 -0
- package/styles/assets/organic-sans.ttf +0 -0
- package/styles/bauhaus.css +881 -110
- package/styles/bento.css +1182 -113
- package/styles/brutalism.css +266 -15
- package/styles/clay.css +1307 -72
- package/styles/compat-layout.css +1 -2
- package/styles/components.css +107 -36
- package/styles/content-overflow.css +11 -5
- package/styles/cyberpunk.css +1856 -51
- package/styles/data-terminal.css +1122 -18
- package/styles/editorial-luxe.css +581 -17
- package/styles/industrial-utility.css +1775 -16
- package/styles/interactive-surface-bridge.css +30 -20
- package/styles/interactive-surface-theme.css +21 -11
- package/styles/maximalist.css +1215 -133
- package/styles/minimal-saas.css +465 -93
- package/styles/native-elements.css +347 -171
- package/styles/neo-noir.css +661 -19
- package/styles/neumorphism.css +1021 -149
- package/styles/organic-modern.css +693 -23
- package/styles/paper-editorial.css +1053 -17
- package/styles/retro-glass.css +639 -50
- package/styles/retrofuturism.css +948 -60
- package/styles/tactile.css +1813 -111
- package/styles/technical-blueprint.css +673 -22
- package/styles/theme-colors.css +412 -2
- package/styles/y2k.css +954 -46
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# Library-wide Theme Fallback and Fidelity Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
4
|
+
|
|
5
|
+
**Goal:** Make all 20 presets use design-reference fallback colors only when no color theme is selected while preserving theme ownership, accessibility, and reference-specific light, dark, and contrast identities.
|
|
6
|
+
|
|
7
|
+
**Architecture:** Each preset publishes mode-specific fallback RGB channels and resolves its public color roles with `var(--usk-*-rgb, var(--<prefix>-fallback-*-rgb))`. Shared native, semantic, and overflow layers activate for `[data-ui][data-mode]`; explicit themes continue to define the `--usk-*` producer channels and therefore override every preset fallback without changing preset geometry or material recipes.
|
|
8
|
+
|
|
9
|
+
**Tech Stack:** CSS custom properties and cascade layers, Node.js test runner, css-tree, Stylelint, Lightning CSS, Playwright, axe-core.
|
|
10
|
+
|
|
11
|
+
**Spec:** `docs/superpowers/specs/2026-09-04-library-wide-theme-fallback-and-fidelity-design.md`
|
|
12
|
+
|
|
13
|
+
## Global Constraints
|
|
14
|
+
|
|
15
|
+
- Preserve all public preset IDs, prefixes, class names, entrypoints, manifest schema, and cascade layer order.
|
|
16
|
+
- Preserve unrelated dirty working-tree changes.
|
|
17
|
+
- `data-ui` and `data-mode` remain required; `data-theme` becomes optional.
|
|
18
|
+
- Explicit themes own every visible paint role; no-theme fallbacks match the retained design references.
|
|
19
|
+
- Run focused tests during implementation and the full verification chain only after all implementation tasks are complete.
|
|
20
|
+
- Write production JavaScript comments as professional JSDoc parseable by jsdoc2md.
|
|
21
|
+
- Update generated CSS only with `npm.cmd run build`.
|
|
22
|
+
- Do not deploy, publish, push, or rewrite the branch.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
### Task 1: Lock the optional-theme semantic contract
|
|
27
|
+
|
|
28
|
+
**Files:**
|
|
29
|
+
- Create: `tests/theme-fallbacks.test.js`
|
|
30
|
+
- Modify: `tests/theme-colors.test.js`
|
|
31
|
+
- Modify: `scripts/check-contrast.mjs`
|
|
32
|
+
|
|
33
|
+
**Interfaces:**
|
|
34
|
+
- Consumes: `manifest.presets`, `manifest.modes`, and the existing 23-role semantic color list.
|
|
35
|
+
- Produces: static assertions for fallback resolution and exported `validateFallbackContrast(cssByPreset)` coverage used by the contrast CLI.
|
|
36
|
+
|
|
37
|
+
- [ ] **Step 1: Write the failing static contract test**
|
|
38
|
+
|
|
39
|
+
Create a manifest-driven test that requires every preset/mode to expose all 23 `--<prefix>-fallback-*-rgb` channels, requires each resolved public role to use the corresponding `--usk-*` channel with the preset fallback as the second argument, and requires themed direct aliases to remain present for build-time extraction.
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
test('every preset resolves explicit themes before its mode fallback palette', () => {
|
|
43
|
+
for (const { id, prefix } of manifest.presets) {
|
|
44
|
+
const css = read(`styles/${id}.css`);
|
|
45
|
+
for (const mode of manifest.modes) {
|
|
46
|
+
const block = exactBlock(css, `[data-ui="${id}"][data-mode="${mode}"]`);
|
|
47
|
+
for (const role of colorRoles) {
|
|
48
|
+
assert.match(block, new RegExp(`--${prefix}-fallback-${role}-rgb:\\s*\\d+ \\d+ \\d+;`));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const resolver = exactBlock(css, `[data-ui="${id}"][data-mode]`);
|
|
52
|
+
for (const role of colorRoles) {
|
|
53
|
+
assert.match(
|
|
54
|
+
resolver,
|
|
55
|
+
new RegExp(`--${prefix}-${role}-rgb:\\s*var\\(--usk-${role}-rgb,\\s*var\\(--${prefix}-fallback-${role}-rgb\\)\\);`)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- [ ] **Step 2: Run only the new test and verify RED**
|
|
63
|
+
|
|
64
|
+
Run: `node --test tests/theme-fallbacks.test.js`
|
|
65
|
+
|
|
66
|
+
Expected: FAIL because most presets do not expose fallback role blocks or a fallback-aware resolver.
|
|
67
|
+
|
|
68
|
+
- [ ] **Step 3: Extend the contrast checker test seam**
|
|
69
|
+
|
|
70
|
+
Add a failing unit assertion in `tests/contrast-contract.test.js` for an exported fallback validator that rejects a no-theme palette whose text/background ratio is below the existing threshold.
|
|
71
|
+
|
|
72
|
+
- [ ] **Step 4: Run the single contrast contract test and verify RED**
|
|
73
|
+
|
|
74
|
+
Run: `node --test tests/contrast-contract.test.js`
|
|
75
|
+
|
|
76
|
+
Expected: FAIL because `validateFallbackContrast` is not exported.
|
|
77
|
+
|
|
78
|
+
- [ ] **Step 5: Implement the minimal fallback contrast validator**
|
|
79
|
+
|
|
80
|
+
Reuse the existing RGB parser and contrast functions. Validate the same text/surface, action/foreground, status/foreground, border, and control-edge pairs for the 60 preset/mode fallback states. Document the exported function with JSDoc.
|
|
81
|
+
|
|
82
|
+
- [ ] **Step 6: Run the contrast contract test and verify GREEN**
|
|
83
|
+
|
|
84
|
+
Run: `node --test tests/contrast-contract.test.js`
|
|
85
|
+
|
|
86
|
+
Expected: PASS.
|
|
87
|
+
|
|
88
|
+
### Task 2: Make shared accessibility layers independent of `data-theme`
|
|
89
|
+
|
|
90
|
+
**Files:**
|
|
91
|
+
- Modify: `styles/native-elements.css`
|
|
92
|
+
- Modify: `styles/components.css`
|
|
93
|
+
- Modify: `styles/content-overflow.css`
|
|
94
|
+
- Modify: `tests/native-elements-contract.test.js`
|
|
95
|
+
- Modify: `tests/semantic-component-contract.test.js`
|
|
96
|
+
|
|
97
|
+
**Interfaces:**
|
|
98
|
+
- Consumes: resolved `--usk-native-*` and preset-prefixed roles from Task 1.
|
|
99
|
+
- Produces: shared native and semantic behavior under `[data-ui][data-mode]` for themed and no-theme roots.
|
|
100
|
+
|
|
101
|
+
- [ ] **Step 1: Write the failing shared-selector test**
|
|
102
|
+
|
|
103
|
+
Require native foundations, focus-visible rules, reduced-motion rules, contrast reinforcement, forced-colors rules, component containment, and overflow guards to activate through `[data-ui][data-mode]` without a `data-theme` dependency.
|
|
104
|
+
|
|
105
|
+
- [ ] **Step 2: Run the native contract test and verify RED**
|
|
106
|
+
|
|
107
|
+
Run: `node --test tests/native-elements-contract.test.js`
|
|
108
|
+
|
|
109
|
+
Expected: FAIL on the current `[data-ui][data-theme][data-mode]` selectors.
|
|
110
|
+
|
|
111
|
+
- [ ] **Step 3: Broaden only shared activation selectors**
|
|
112
|
+
|
|
113
|
+
Replace theme-required shared roots with `[data-ui][data-mode]`. Keep theme producer selectors in `styles/theme-colors.css` unchanged so no fallback leaks into explicit schemes.
|
|
114
|
+
|
|
115
|
+
- [ ] **Step 4: Run the native contract test and verify GREEN**
|
|
116
|
+
|
|
117
|
+
Run: `node --test tests/native-elements-contract.test.js`
|
|
118
|
+
|
|
119
|
+
Expected: PASS.
|
|
120
|
+
|
|
121
|
+
- [ ] **Step 5: Run the semantic component contract test once**
|
|
122
|
+
|
|
123
|
+
Run: `node --test tests/semantic-component-contract.test.js`
|
|
124
|
+
|
|
125
|
+
Expected: PASS after selector fingerprints are regenerated at the final build; if the only failure is the known generated artifact fingerprint, defer that fingerprint update to Task 6.
|
|
126
|
+
|
|
127
|
+
### Task 3: Add reference-derived fallbacks and resolvers to the first ten presets
|
|
128
|
+
|
|
129
|
+
**Files:**
|
|
130
|
+
- Modify: `styles/minimal-saas.css`
|
|
131
|
+
- Modify: `styles/bento.css`
|
|
132
|
+
- Modify: `styles/maximalist.css`
|
|
133
|
+
- Modify: `styles/bauhaus.css`
|
|
134
|
+
- Modify: `styles/tactile.css`
|
|
135
|
+
- Modify: `styles/neumorphism.css`
|
|
136
|
+
- Modify: `styles/retrofuturism.css`
|
|
137
|
+
- Modify: `styles/brutalism.css`
|
|
138
|
+
- Modify: `styles/cyberpunk.css`
|
|
139
|
+
- Modify: `styles/y2k.css`
|
|
140
|
+
|
|
141
|
+
**Interfaces:**
|
|
142
|
+
- Consumes: the Task 1 resolver contract and the retained template references.
|
|
143
|
+
- Produces: complete light/dark/contrast fallback palettes and theme-derived material paint for presets 1–10.
|
|
144
|
+
|
|
145
|
+
- [ ] **Step 1: Add one failing preset assertion at a time**
|
|
146
|
+
|
|
147
|
+
For each preset, add its three fallback blocks to the shared test fixture expectations before editing production CSS. Each role must use explicit RGB integers and include paired foreground roles.
|
|
148
|
+
|
|
149
|
+
- [ ] **Step 2: Run only that preset's test case and verify RED**
|
|
150
|
+
|
|
151
|
+
Run these exact commands in order, stopping at the first failure:
|
|
152
|
+
|
|
153
|
+
```powershell
|
|
154
|
+
node --test --test-name-pattern="minimal-saas" tests/theme-fallbacks.test.js
|
|
155
|
+
node --test --test-name-pattern="bento" tests/theme-fallbacks.test.js
|
|
156
|
+
node --test --test-name-pattern="maximalist" tests/theme-fallbacks.test.js
|
|
157
|
+
node --test --test-name-pattern="bauhaus" tests/theme-fallbacks.test.js
|
|
158
|
+
node --test --test-name-pattern="tactile" tests/theme-fallbacks.test.js
|
|
159
|
+
node --test --test-name-pattern="neumorphism" tests/theme-fallbacks.test.js
|
|
160
|
+
node --test --test-name-pattern="retrofuturism" tests/theme-fallbacks.test.js
|
|
161
|
+
node --test --test-name-pattern="brutalism" tests/theme-fallbacks.test.js
|
|
162
|
+
node --test --test-name-pattern="cyberpunk" tests/theme-fallbacks.test.js
|
|
163
|
+
node --test --test-name-pattern="y2k" tests/theme-fallbacks.test.js
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Expected: FAIL because the selected preset is missing the new contract.
|
|
167
|
+
|
|
168
|
+
- [ ] **Step 3: Implement that preset's fallback and resolver**
|
|
169
|
+
|
|
170
|
+
Add mode-specific fallback channels, move runtime aliases/native mappings to `[data-ui="<preset>"][data-mode]`, retain a small direct themed alias seam, and derive material paint from resolved prefixed roles.
|
|
171
|
+
|
|
172
|
+
- [ ] **Step 4: Run only that preset's test case and verify GREEN**
|
|
173
|
+
|
|
174
|
+
Rerun only the exact preset command from Step 2.
|
|
175
|
+
|
|
176
|
+
Expected: PASS.
|
|
177
|
+
|
|
178
|
+
- [ ] **Step 5: Repeat Steps 1–4 sequentially for all ten listed presets**
|
|
179
|
+
|
|
180
|
+
Do not rerun a green preset case unless a later shared resolver refactor can affect it.
|
|
181
|
+
|
|
182
|
+
### Task 4: Add reference-derived fallbacks and resolvers to the remaining ten presets
|
|
183
|
+
|
|
184
|
+
**Files:**
|
|
185
|
+
- Modify: `styles/retro-glass.css`
|
|
186
|
+
- Modify: `styles/editorial-luxe.css`
|
|
187
|
+
- Modify: `styles/organic-modern.css`
|
|
188
|
+
- Modify: `styles/industrial-utility.css`
|
|
189
|
+
- Modify: `styles/technical-blueprint.css`
|
|
190
|
+
- Modify: `styles/art-deco.css`
|
|
191
|
+
- Modify: `styles/clay.css`
|
|
192
|
+
- Modify: `styles/data-terminal.css`
|
|
193
|
+
- Modify: `styles/paper-editorial.css`
|
|
194
|
+
- Modify: `styles/neo-noir.css`
|
|
195
|
+
|
|
196
|
+
**Interfaces:**
|
|
197
|
+
- Consumes: the Task 1 resolver contract and the retained paired or combined template references.
|
|
198
|
+
- Produces: complete light/dark/contrast fallback palettes and theme-derived material paint for presets 11–20.
|
|
199
|
+
|
|
200
|
+
- [ ] **Step 1: Add one failing preset assertion at a time**
|
|
201
|
+
|
|
202
|
+
Use the same executable contract as Task 3. Preserve existing in-progress fidelity work in these dirty files and add only the missing fallback/theme boundary.
|
|
203
|
+
|
|
204
|
+
- [ ] **Step 2: Run only that preset's test case and verify RED**
|
|
205
|
+
|
|
206
|
+
Run these exact commands in order, stopping at the first failure:
|
|
207
|
+
|
|
208
|
+
```powershell
|
|
209
|
+
node --test --test-name-pattern="retro-glass" tests/theme-fallbacks.test.js
|
|
210
|
+
node --test --test-name-pattern="editorial-luxe" tests/theme-fallbacks.test.js
|
|
211
|
+
node --test --test-name-pattern="organic-modern" tests/theme-fallbacks.test.js
|
|
212
|
+
node --test --test-name-pattern="industrial-utility" tests/theme-fallbacks.test.js
|
|
213
|
+
node --test --test-name-pattern="technical-blueprint" tests/theme-fallbacks.test.js
|
|
214
|
+
node --test --test-name-pattern="art-deco" tests/theme-fallbacks.test.js
|
|
215
|
+
node --test --test-name-pattern="clay" tests/theme-fallbacks.test.js
|
|
216
|
+
node --test --test-name-pattern="data-terminal" tests/theme-fallbacks.test.js
|
|
217
|
+
node --test --test-name-pattern="paper-editorial" tests/theme-fallbacks.test.js
|
|
218
|
+
node --test --test-name-pattern="neo-noir" tests/theme-fallbacks.test.js
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Expected: FAIL on the missing or incomplete fallback resolver.
|
|
222
|
+
|
|
223
|
+
- [ ] **Step 3: Implement that preset's fallback and resolver**
|
|
224
|
+
|
|
225
|
+
Where Technical Blueprint or Data Terminal already contain no-theme work, reconcile it into the shared contract without deleting reference-fidelity declarations or weakening direct alias extraction.
|
|
226
|
+
|
|
227
|
+
- [ ] **Step 4: Run only that preset's test case and verify GREEN**
|
|
228
|
+
|
|
229
|
+
Rerun only the exact preset command from Step 2.
|
|
230
|
+
|
|
231
|
+
Expected: PASS.
|
|
232
|
+
|
|
233
|
+
- [ ] **Step 5: Repeat Steps 1–4 sequentially for all ten listed presets**
|
|
234
|
+
|
|
235
|
+
Do not rerun green cases unnecessarily.
|
|
236
|
+
|
|
237
|
+
### Task 5: Prove runtime theme ownership and accessibility states
|
|
238
|
+
|
|
239
|
+
**Files:**
|
|
240
|
+
- Modify: `tests/e2e/demo.spec.js`
|
|
241
|
+
- Modify: `tests/e2e/accessibility.spec.js`
|
|
242
|
+
- Modify: `tests/demo-visual.spec.mjs`
|
|
243
|
+
- Modify: `scripts/preset-identities.mjs`
|
|
244
|
+
- Modify: `design-qa.md`
|
|
245
|
+
|
|
246
|
+
**Interfaces:**
|
|
247
|
+
- Consumes: all 20 fallback-aware preset styles and the existing component/native demo specimens.
|
|
248
|
+
- Produces: computed-style and visual evidence for themed, fallback, light, dark, contrast, focus, disabled, reduced-motion, and forced-colors states.
|
|
249
|
+
|
|
250
|
+
- [ ] **Step 1: Write a failing computed-style matrix case**
|
|
251
|
+
|
|
252
|
+
For each preset and mode, capture representative prefixed card/button/input/range/progress paint, semantic `.ui-*` paint, and native element paint without `data-theme`; then apply two materially different themes and assert that semantic paint changes while geometry remains stable.
|
|
253
|
+
|
|
254
|
+
- [ ] **Step 2: Run only the new Chromium matrix case and verify RED**
|
|
255
|
+
|
|
256
|
+
Run: `npm.cmd exec playwright test -- --config playwright.config.js tests/e2e/demo.spec.js --project=chromium --grep "fallback and explicit theme ownership"`
|
|
257
|
+
|
|
258
|
+
Expected: FAIL for presets whose shared or authored selectors still require `data-theme` or whose material paint is fixed.
|
|
259
|
+
|
|
260
|
+
- [ ] **Step 3: Repair only reported cascade leaks**
|
|
261
|
+
|
|
262
|
+
Change fixed visible paint to resolved semantic channels, preserve neutral optical overlays, and add later preset-specific native overrides only where shared selector order wins unexpectedly.
|
|
263
|
+
|
|
264
|
+
- [ ] **Step 4: Rerun the single Chromium matrix case and verify GREEN**
|
|
265
|
+
|
|
266
|
+
Run the exact command from Step 2.
|
|
267
|
+
|
|
268
|
+
Expected: PASS.
|
|
269
|
+
|
|
270
|
+
- [ ] **Step 5: Add and run the focused accessibility case**
|
|
271
|
+
|
|
272
|
+
Verify focus visibility, labels, disabled states, and axe results for one fallback and one explicit theme in each mode. Run only the new named accessibility case until it passes.
|
|
273
|
+
|
|
274
|
+
- [ ] **Step 6: Update executable identity traits and the QA ledger**
|
|
275
|
+
|
|
276
|
+
Record each template's typography, density, geometry, material, feedback, and data evidence. Keep paint traits semantic so theme switching cannot erase identity.
|
|
277
|
+
|
|
278
|
+
### Task 6: Regenerate artifacts and run the final verification chain
|
|
279
|
+
|
|
280
|
+
**Files:**
|
|
281
|
+
- Generated: `dist/ui-style-kit.css`
|
|
282
|
+
- Generated: `dist/ui-style-kit.min.css`
|
|
283
|
+
- Generated: `dist/ui-style-kit.visual.css`
|
|
284
|
+
- Generated: `dist/ui-style-kit.visual.min.css`
|
|
285
|
+
- Generated: `dist/ui-style-kit.with-bridge.css`
|
|
286
|
+
- Generated: `dist/ui-style-kit.with-bridge.min.css`
|
|
287
|
+
- Generated: `dist/visual/*.css`
|
|
288
|
+
- Modify if generated fingerprint changes: `tests/semantic-component-contract.test.js`
|
|
289
|
+
- Modify if bundle sizes change: `README.md`
|
|
290
|
+
|
|
291
|
+
**Interfaces:**
|
|
292
|
+
- Consumes: all authored source and tests from Tasks 1–5.
|
|
293
|
+
- Produces: publishable generated bundles and final local verification evidence.
|
|
294
|
+
|
|
295
|
+
- [ ] **Step 1: Build once**
|
|
296
|
+
|
|
297
|
+
Run: `npm.cmd run build`
|
|
298
|
+
|
|
299
|
+
Expected: all default, visual-only, focused visual, and compatibility entrypoints regenerate successfully.
|
|
300
|
+
|
|
301
|
+
- [ ] **Step 2: Update generated artifact fingerprints if required**
|
|
302
|
+
|
|
303
|
+
Use the build output as the only source of truth. Update the exact declaration count and SHA-256 expectations, then run only `tests/semantic-component-contract.test.js`.
|
|
304
|
+
|
|
305
|
+
- [ ] **Step 3: Run the final static chain sequentially**
|
|
306
|
+
|
|
307
|
+
Run, in order, stopping at the first failure:
|
|
308
|
+
|
|
309
|
+
```powershell
|
|
310
|
+
npm.cmd run lint
|
|
311
|
+
npm.cmd run test:unit
|
|
312
|
+
npm.cmd run check:contrast
|
|
313
|
+
npm.cmd run check:compat
|
|
314
|
+
npm.cmd run check:ownership
|
|
315
|
+
npm.cmd run check:package
|
|
316
|
+
git diff --check
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
- [ ] **Step 4: Run focused browser and accessibility verification**
|
|
320
|
+
|
|
321
|
+
Run the new theme-ownership case, reference-fidelity cases, and axe case. Do not claim cross-browser success for an engine that was not freshly exercised.
|
|
322
|
+
|
|
323
|
+
- [ ] **Step 5: Run the visual suite once at the end**
|
|
324
|
+
|
|
325
|
+
Run: `npm.cmd run test:visual`
|
|
326
|
+
|
|
327
|
+
Expected: approved snapshots pass or are updated only after direct reference/prototype comparison confirms the intended differences.
|
|
328
|
+
|
|
329
|
+
- [ ] **Step 6: Review the integrated diff**
|
|
330
|
+
|
|
331
|
+
Confirm that only approved source, tests, documentation, generated bundles, and reviewed snapshots changed. Report unrelated pre-existing dirty files separately and do not stage, revert, or overwrite them.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Library-wide Theme Fallback and Fidelity Design
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Approved on 2026-09-04. The user selected the shared semantic resolver with preset-owned no-theme fallback palettes.
|
|
6
|
+
|
|
7
|
+
## Objective
|
|
8
|
+
|
|
9
|
+
Make all 20 public UI presets satisfy one predictable color contract while preserving their reference-specific visual identities:
|
|
10
|
+
|
|
11
|
+
- An explicit `data-theme` owns every visible paint role.
|
|
12
|
+
- Without `data-theme`, each preset supplies an accessible light, dark, or contrast fallback palette derived from its retained design reference.
|
|
13
|
+
- Typography, geometry, density, texture, elevation, and interaction behavior remain preset-owned in every color scheme.
|
|
14
|
+
- Shared native-element, semantic-component, overflow, accessibility, reduced-motion, high-contrast, and forced-colors behavior works with or without `data-theme`.
|
|
15
|
+
|
|
16
|
+
## Public Contract
|
|
17
|
+
|
|
18
|
+
The supported root states are:
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<body data-ui="minimal-saas" data-mode="light">
|
|
22
|
+
<body data-ui="minimal-saas" data-theme="arctic-indigo" data-mode="light">
|
|
23
|
+
<body data-ui="minimal-saas" data-mode="dark">
|
|
24
|
+
<body data-ui="minimal-saas" data-theme="arctic-indigo" data-mode="dark">
|
|
25
|
+
<body data-ui="minimal-saas" data-mode="contrast">
|
|
26
|
+
<body data-ui="minimal-saas" data-theme="arctic-indigo" data-mode="contrast">
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`data-ui` and `data-mode` remain required. `data-theme` becomes optional.
|
|
30
|
+
|
|
31
|
+
## Color Ownership
|
|
32
|
+
|
|
33
|
+
Each preset resolves its public RGB roles through the same fallback-aware expression:
|
|
34
|
+
|
|
35
|
+
```css
|
|
36
|
+
--<prefix>-primary-rgb: var(--usk-primary-rgb, var(--<prefix>-fallback-primary-rgb));
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The shared theme registry defines `--usk-*` only for explicit theme/mode combinations. Therefore:
|
|
40
|
+
|
|
41
|
+
1. An explicit theme always wins.
|
|
42
|
+
2. A missing theme activates the preset fallback.
|
|
43
|
+
3. Preset component rules consume only resolved prefixed roles or material recipes derived from those roles.
|
|
44
|
+
4. Direct compatibility aliases remain available where the build and contrast tooling require literal `var(--usk-*-rgb)` declarations.
|
|
45
|
+
|
|
46
|
+
Opaque surfaces, highlights, shadows, grids, ornaments, glass, enamel, paper, clay, metal, terminal cells, and other material paint must derive from resolved semantic channels. Fixed neutral overlays are permitted only for optical lighting or forced-colors interoperability and must not prevent a theme change from visibly recoloring the element.
|
|
47
|
+
|
|
48
|
+
## Reference Fidelity
|
|
49
|
+
|
|
50
|
+
The retained artifact-template references are authoritative for no-theme fallback identity and for non-color visual construction.
|
|
51
|
+
|
|
52
|
+
| Preset | Reference identity to preserve |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| Minimal SaaS | restrained indigo actions, thin cool borders, compact radii, calm low-shadow panels |
|
|
55
|
+
| Bento UI | soft mosaic tiles, rounded modular cards, friendly blue actions, pastel feedback |
|
|
56
|
+
| Maximalist | loud collage geometry, heavy display type, layered cut-paper controls, multi-accent feedback |
|
|
57
|
+
| Bauhaus | rigid workshop grid, black rules, primary geometric accents, condensed typography |
|
|
58
|
+
| Tactile | warm paper, dark sidebar, copper action, olive gauges, shallow bevels and recessed tracks |
|
|
59
|
+
| Neumorphism | soft continuous canvas, paired raised/inset shadows, blue controls, rounded molded geometry |
|
|
60
|
+
| Retrofuturism | enamel shells, metallic double keylines, coral actions, teal bays, ringed controls |
|
|
61
|
+
| Brutalism | hard black rules, square controls, blue/yellow/red utility accents, dense condensed type |
|
|
62
|
+
| Cyberpunk | clipped technical frames, cyan/magenta signals, black or pale command surfaces |
|
|
63
|
+
| Y2K | dense window chrome, classic blue selection, square native controls, pixel-era hierarchy |
|
|
64
|
+
| Retro Glass | brushed application chrome, glossy navigation, inset glass panes, striped gauges, dark dock |
|
|
65
|
+
| Editorial Luxe | double rules, Didone display type, forest actions, antique gold, oxblood danger |
|
|
66
|
+
| Organic Modern | warm natural surfaces, olive hairlines, rust alerts, restrained rounded geometry |
|
|
67
|
+
| Industrial Utility | squared metal panels, recessed instruments, amber controls, calibrated safety states |
|
|
68
|
+
| Technical Blueprint | graph-paper grid, cyan or technical-blue linework, square measured controls |
|
|
69
|
+
| Art Deco | symmetrical stepped frames, metallic keylines, teal/gold/oxblood jewel controls |
|
|
70
|
+
| Clay | continuous sculpted slab, shallow seams, mineral pigments, hand-pressed components |
|
|
71
|
+
| Data Terminal | one-pixel cells, monospaced type, strict semantic command colors, bracketed actions |
|
|
72
|
+
| Paper Editorial | physical manual sheet, ruled print grid, cream or ink stock, limited spot colors |
|
|
73
|
+
| Neo Noir | cinematic rules, skewed trapezoids, amber/teal/red/violet signals, film-grain material |
|
|
74
|
+
|
|
75
|
+
For templates containing both light and dark reference panels, both panels define the paired fallback modes. For single-mode references, the dark or light counterpart must preserve the same geometry and semantic hierarchy while using an accessible inverse material treatment. Contrast mode intensifies the same identity rather than becoming a third unrelated design.
|
|
76
|
+
|
|
77
|
+
## Shared Accessibility Behavior
|
|
78
|
+
|
|
79
|
+
The shared selectors in `native-elements.css`, generated components, and content-overflow coverage must target `[data-ui][data-mode]`, not require `[data-theme]`.
|
|
80
|
+
|
|
81
|
+
Every supported state must retain:
|
|
82
|
+
|
|
83
|
+
- visible `:focus-visible` indicators;
|
|
84
|
+
- readable disabled, read-only, valid, invalid, loading, selected, and indeterminate states;
|
|
85
|
+
- reduced-motion behavior;
|
|
86
|
+
- `prefers-contrast: more` reinforcement;
|
|
87
|
+
- `forced-colors: active` interoperability;
|
|
88
|
+
- native controls that inherit the active preset geometry and resolved semantic paint;
|
|
89
|
+
- semantic `.ui-*` components that match their prefixed counterparts.
|
|
90
|
+
|
|
91
|
+
WCAG contrast gates remain at the repository's existing thresholds. The contrast matrix must cover explicit themes and every no-theme fallback state.
|
|
92
|
+
|
|
93
|
+
## Implementation Boundaries
|
|
94
|
+
|
|
95
|
+
- Preserve all public preset IDs, prefixes, class names, entrypoints, manifest schema, and cascade layer order.
|
|
96
|
+
- Preserve unrelated dirty working-tree changes.
|
|
97
|
+
- Do not introduce a new runtime dependency or JavaScript theming requirement.
|
|
98
|
+
- Do not create new artwork; retained references and existing real assets remain the visual source.
|
|
99
|
+
- Generated distribution files are updated only through `npm.cmd run build`.
|
|
100
|
+
- No deployment, publication, push, or branch rewrite is part of this work.
|
|
101
|
+
|
|
102
|
+
## Verification Evidence
|
|
103
|
+
|
|
104
|
+
Completion requires fresh evidence for:
|
|
105
|
+
|
|
106
|
+
1. Static fallback/theme ownership contracts for all 20 presets and 23 semantic color roles.
|
|
107
|
+
2. Shared native and semantic coverage with and without `data-theme`.
|
|
108
|
+
3. WCAG contrast for 1,200 explicit theme states plus 60 fallback states.
|
|
109
|
+
4. Focus, reduced-motion, `prefers-contrast`, and forced-colors behavior.
|
|
110
|
+
5. Per-preset computed-style theme switching across representative prefixed, semantic, and native elements.
|
|
111
|
+
6. Reference-fidelity traits across typography, density, geometry, material, feedback, and data surfaces.
|
|
112
|
+
7. Regenerated default, visual-only, focused visual, and compatibility bundles.
|
|
113
|
+
8. Final lint, unit, contrast, compatibility, ownership, package, focused browser, axe, and visual checks.
|