ui-style-kit-css 1.2.2 → 2.0.2

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +44 -1
  2. package/CONTRIBUTING.md +6 -5
  3. package/README.md +141 -17
  4. package/STYLE-MAP.md +24 -0
  5. package/demo/assets/README.md +23 -0
  6. package/demo/assets/android-chrome-192x192.png +0 -0
  7. package/demo/assets/android-chrome-512x512.png +0 -0
  8. package/demo/assets/apple-touch-icon.png +0 -0
  9. package/demo/assets/browserconfig.xml +9 -0
  10. package/demo/assets/favicon-128x128.png +0 -0
  11. package/demo/assets/favicon-16x16.png +0 -0
  12. package/demo/assets/favicon-256x256.png +0 -0
  13. package/demo/assets/favicon-32x32.png +0 -0
  14. package/demo/assets/favicon-384x384.png +0 -0
  15. package/demo/assets/favicon-48x48.png +0 -0
  16. package/demo/assets/favicon-64x64.png +0 -0
  17. package/demo/assets/favicon-96x96.png +0 -0
  18. package/demo/assets/favicon-head-snippet.html +11 -0
  19. package/demo/assets/favicon-master-1024.png +0 -0
  20. package/demo/assets/favicon.ico +0 -0
  21. package/demo/assets/favicon.svg +26 -0
  22. package/demo/assets/mstile-150x150.png +0 -0
  23. package/demo/assets/safari-pinned-tab.svg +3 -0
  24. package/demo/assets/site.webmanifest +25 -0
  25. package/demo/index.html +1087 -73
  26. package/dist/ui-style-kit.css +2932 -8339
  27. package/dist/ui-style-kit.min.css +1 -1
  28. package/dist/ui-style-kit.with-bridge.css +5861 -0
  29. package/dist/ui-style-kit.with-bridge.min.css +1 -0
  30. package/docs/PUBLISHING.md +3 -3
  31. package/docs/STYLE-GUIDE.md +3 -1
  32. package/docs/TOKENS.md +215 -10
  33. package/package.json +17 -5
  34. package/styles/bauhaus.css +142 -702
  35. package/styles/bento.css +142 -701
  36. package/styles/brutalism.css +137 -702
  37. package/styles/cyberpunk.css +128 -699
  38. package/styles/interactive-surface-bridge.css +147 -311
  39. package/styles/maximalist.css +143 -702
  40. package/styles/minimal-saas.css +138 -701
  41. package/styles/native-elements.css +374 -0
  42. package/styles/neumorphism.css +144 -702
  43. package/styles/retro-glass.css +131 -702
  44. package/styles/retrofuturism.css +144 -702
  45. package/styles/tactile.css +142 -701
  46. package/styles/theme-colors.css +787 -0
  47. package/styles/y2k.css +122 -696
@@ -7,7 +7,7 @@ npm run check
7
7
  npm run pack:dry-run
8
8
  ```
9
9
 
10
- `npm run check` rebuilds dist CSS, runs stylelint, executes unit package checks, verifies contrast pairs, and confirms package metadata. `npm run pack:dry-run` shows the exact files that would publish.
10
+ `npm run check` rebuilds dist CSS, runs stylelint, executes package, class API, shared theme-color, and vendor-prefix unit checks, validates core text/link contrast pairs and filled component `on-*` contrast pairs, and confirms package metadata. `npm run pack:dry-run` shows the exact files that would publish.
11
11
 
12
12
  ## Publish
13
13
 
@@ -15,7 +15,7 @@ npm run pack:dry-run
15
15
  npm publish
16
16
  ```
17
17
 
18
- For GitHub releases, create or dispatch a release for the matching package tag, such as `v1.2.2`. The release workflows verify that `package.json`, `package-lock.json`, and `CHANGELOG.md` are aligned before publishing.
18
+ For GitHub releases, create or dispatch a release for the matching package tag, such as `v2.0.2`. The release workflows verify that `package.json`, `package-lock.json`, `CHANGELOG.md`, and generated dist banners are aligned before publishing.
19
19
 
20
20
  ## Versioning
21
21
 
@@ -25,4 +25,4 @@ npm run release:minor
25
25
  npm run release:major
26
26
  ```
27
27
 
28
- Use patch for fixes, minor for new themes/styles, and major for breaking public API changes.
28
+ Use patch for fixes, minor for new themes/styles, and major for breaking public API changes. The 2.x release line is major because color-scheme authoring moved from per-UI `--<prefix>-*-rgb` blocks to shared `--usk-*-rgb` roles in `styles/theme-colors.css`.
@@ -13,8 +13,10 @@
13
13
  | Cyberpunk | Security, gaming, encryption, developer demos, nightlife/tech branding |
14
14
  | Y2K | Nostalgic, playful, music/fashion/event sites |
15
15
  | Retro Glass | Futuristic premium apps, glass dashboards, hero sections |
16
- Use `data-mode="contrast"` for high-contrast variants and pair it with semantic HTML for best accessibility outcomes.
17
16
 
17
+ All styles share the same 10 color schemes through `styles/theme-colors.css`, so changing `data-theme` affects the active color scheme independently from the selected UI treatment.
18
+
19
+ Use `data-mode="contrast"` for high-contrast variants and pair it with semantic HTML for best accessibility outcomes.
18
20
 
19
21
  ## Visual regression baseline
20
22
 
package/docs/TOKENS.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Token Contract
2
2
 
3
- Each UI style uses its own prefix, but the token shape is intentionally consistent.
3
+ Each UI style uses its own prefix, but concrete color schemes are shared. The 2.0 token model is deliberately compact:
4
+
5
+ ```txt
6
+ shared scheme channels -> prefixed aliases -> UI rules
7
+ ```
8
+
9
+ `styles/theme-colors.css` defines the active scheme and mode once as `--usk-*` RGB channels. Each UI style maps those shared channels to its public prefix, then component rules consume prefixed functional variables. `styles/native-elements.css` owns native HTML fallback selectors and consumes `--usk-native-*` tokens that each preset maps back to its own public variables.
4
10
 
5
11
  ## Prefixes
6
12
 
@@ -18,41 +24,132 @@ Each UI style uses its own prefix, but the token shape is intentionally consiste
18
24
  | Y2K | `y2k` |
19
25
  | Retro Glass | `rg` |
20
26
 
21
- ## Stable token families
27
+ ## Stable functional tokens
22
28
 
23
29
  Replace `<prefix>` with the style prefix:
24
30
 
25
31
  ```css
26
32
  --<prefix>-bg
33
+ --<prefix>-fg
27
34
  --<prefix>-surface
35
+ --<prefix>-surface-fg
28
36
  --<prefix>-surface-strong
29
37
  --<prefix>-surface-soft
30
38
  --<prefix>-text
31
39
  --<prefix>-text-muted
40
+ --<prefix>-muted
32
41
  --<prefix>-border
42
+ --<prefix>-control-bg
43
+ --<prefix>-control-fg
33
44
  --<prefix>-primary
34
45
  --<prefix>-primary-hover
35
- --<prefix>-primary-text
36
46
  --<prefix>-secondary
37
47
  --<prefix>-secondary-hover
38
- --<prefix>-secondary-text
39
48
  --<prefix>-accent
40
49
  --<prefix>-success
41
50
  --<prefix>-warning
42
51
  --<prefix>-danger
43
52
  --<prefix>-link
44
53
  --<prefix>-focus
54
+ --<prefix>-theme-bg
55
+ --<prefix>-theme-bg-size
56
+ --<prefix>-card-bg
57
+ --<prefix>-spinner-track
58
+ --<prefix>-spinner-stroke
59
+ --<prefix>-spinner-accent
60
+ ```
61
+
62
+ ## Filled-surface text aliases
63
+
64
+ Filled UI uses compact `on-*` aliases instead of a large foreground-token matrix:
65
+
66
+ ```css
67
+ --<prefix>-on-primary
68
+ --<prefix>-on-secondary
69
+ --<prefix>-on-accent
70
+ --<prefix>-on-success
71
+ --<prefix>-on-warning
72
+ --<prefix>-on-danger
73
+ ```
74
+
75
+ Backward-compatible aliases `--<prefix>-primary-text` and `--<prefix>-secondary-text` remain available and point to the same filled-surface text colors.
76
+
77
+ ## Shared RGB palette channels
78
+
79
+ Concrete theme/mode blocks now live in `styles/theme-colors.css` and expose shared RGB channels:
80
+
81
+ ```css
82
+ --usk-bg-rgb
83
+ --usk-surface-rgb
84
+ --usk-surface-strong-rgb
85
+ --usk-surface-soft-rgb
86
+ --usk-text-rgb
87
+ --usk-text-muted-rgb
88
+ --usk-border-rgb
89
+ --usk-primary-rgb
90
+ --usk-primary-hover-rgb
91
+ --usk-primary-text-rgb
92
+ --usk-secondary-rgb
93
+ --usk-secondary-hover-rgb
94
+ --usk-secondary-text-rgb
95
+ --usk-accent-rgb
96
+ --usk-accent-text-rgb
97
+ --usk-success-rgb
98
+ --usk-success-text-rgb
99
+ --usk-warning-rgb
100
+ --usk-warning-text-rgb
101
+ --usk-danger-rgb
102
+ --usk-danger-text-rgb
103
+ --usk-link-rgb
104
+ --usk-focus-rgb
45
105
  ```
46
106
 
47
- Most systems also expose RGB source tokens such as:
107
+ Each standalone style file imports the shared color and native layers, then aliases those roles back to the style prefix:
48
108
 
49
109
  ```css
50
- --<prefix>-primary-rgb
51
- --<prefix>-border-rgb
52
- --<prefix>-focus-rgb
110
+ [data-ui="minimal-saas"][data-theme][data-mode] {
111
+ --saas-bg-rgb: var(--usk-bg-rgb);
112
+ --saas-primary-rgb: var(--usk-primary-rgb);
113
+ --saas-primary-text-rgb: var(--usk-primary-text-rgb);
114
+ }
53
115
  ```
54
116
 
55
- These are useful for custom alpha effects:
117
+ ## Native fallback tokens
118
+
119
+ Native HTML coverage is shared in `styles/native-elements.css` to avoid repeating the same semantic selector blocks in every preset. Preset files provide visual mappings for these stable native-layer tokens:
120
+
121
+ ```css
122
+ --usk-native-surface
123
+ --usk-native-surface-strong
124
+ --usk-native-surface-soft
125
+ --usk-native-card-bg
126
+ --usk-native-control-bg
127
+ --usk-native-text
128
+ --usk-native-text-muted
129
+ --usk-native-border
130
+ --usk-native-primary
131
+ --usk-native-primary-hover
132
+ --usk-native-on-primary
133
+ --usk-native-focus
134
+ --usk-native-success
135
+ --usk-native-warning
136
+ --usk-native-danger
137
+ --usk-native-link
138
+ --usk-native-font-body
139
+ --usk-native-font-heading
140
+ --usk-native-font-control
141
+ --usk-native-font-mono
142
+ --usk-native-radius-sm
143
+ --usk-native-radius
144
+ --usk-native-radius-lg
145
+ --usk-native-shadow
146
+ --usk-native-shadow-md
147
+ --usk-native-focus-ring
148
+ ```
149
+
150
+ Consumers usually override the prefixed public tokens, not these internal bridge tokens. Use `--usk-native-*` only when intentionally customizing native fallback styling across every UI preset.
151
+
152
+ Use prefixed RGB aliases for component-local alpha effects:
56
153
 
57
154
  ```css
58
155
  .my-component {
@@ -60,12 +157,120 @@ These are useful for custom alpha effects:
60
157
  }
61
158
  ```
62
159
 
160
+ Use shared `--usk-*` roles when defining or overriding a scheme:
161
+
162
+ ```css
163
+ :where([data-ui][data-theme="arctic-indigo"][data-mode="light"]) {
164
+ --usk-primary-rgb: 72 91 255;
165
+ --usk-primary-hover-rgb: 55 75 230;
166
+ --usk-primary-text-rgb: 255 255 255;
167
+ }
168
+ ```
169
+
170
+ ## Theme-composition tokens
171
+
172
+ The library derives larger visual defaults from the active theme:
173
+
174
+ ```css
175
+ --<prefix>-theme-bg /* page-level background layers */
176
+ --<prefix>-theme-bg-size /* matching background-size list */
177
+ --<prefix>-card-bg /* default card/panel background */
178
+ --<prefix>-control-bg /* default neutral button/toolbar/table-wrap background */
179
+ ```
180
+
181
+ These tokens make color themes visually distinct by changing page atmosphere, card tinting, and neutral control surfaces when `data-theme` or `data-mode` changes.
182
+
183
+ ## Spinner tokens
184
+
185
+ Loading indicators use theme variables by default:
186
+
187
+ ```css
188
+ --<prefix>-spinner-track
189
+ --<prefix>-spinner-stroke
190
+ --<prefix>-spinner-accent
191
+ ```
192
+
193
+ The class utilities are `<prefix>-spinner`, `<prefix>-loading-spinner`, `<prefix>-spinner-sm`, and `<prefix>-spinner-lg`. Native buttons and prefixed buttons also render an inline spinner when `aria-busy="true"` is present.
194
+
195
+ ## Interactive Surface bridge tokens
196
+
197
+ The opt-in bridge maps shared `--usk-*` roles directly to `--interactive-surface-*` tokens. It avoids per-UI token maps so the bridge follows the same shared scheme -> mode role -> component rule flow as the main bundle.
198
+
199
+ Use `.interactive-surface` with `data-surface-variant` for semantic intent and `data-surface-level` for visual depth:
200
+
201
+ ```html
202
+ <button class="interactive-surface" data-surface-variant="primary" data-surface-level="2">
203
+ Save changes
204
+ </button>
205
+ ```
206
+
207
+ Stable bridge attributes:
208
+
209
+ ```txt
210
+ data-surface-variant="primary|secondary|accent|subtle|warning|danger"
211
+ data-surface-level="1|2|3"
212
+ ```
213
+
214
+ The bridge defines visible state layer tokens for hover, active, and focus plus level tokens such as `--interactive-surface-level-1-bg`, `--interactive-surface-level-2-bg`, and `--interactive-surface-level-3-bg`.
215
+
216
+ ## Typography tokens
217
+
218
+ Each style exposes broad and granular font variables:
219
+
220
+ ```css
221
+ --<prefix>-font-sans
222
+ --<prefix>-font-display
223
+ --<prefix>-font-body
224
+ --<prefix>-font-heading
225
+ --<prefix>-font-control
226
+ --<prefix>-font-mono
227
+ ```
228
+
229
+ `--<prefix>-font-body`, `--<prefix>-font-heading`, and `--<prefix>-font-control` default back to `font-sans` or `font-display`, so existing overrides continue to work.
230
+
231
+ ## Palette utilities vs filled UI
232
+
233
+ Semantic text utility classes use direct palette colors:
234
+
235
+ ```css
236
+ .saas-text-primary { color: var(--saas-primary); }
237
+ .saas-text-warning { color: var(--saas-warning); }
238
+ ```
239
+
240
+ Filled UI uses the matching `on-*` alias:
241
+
242
+ ```css
243
+ .saas-button-primary {
244
+ background: var(--saas-primary);
245
+ color: var(--saas-on-primary);
246
+ }
247
+
248
+ .saas-badge-warning {
249
+ background: var(--saas-warning);
250
+ color: var(--saas-on-warning);
251
+ }
252
+ ```
253
+
63
254
  ## Override example
64
255
 
65
256
  ```css
66
257
  /* Consumer CSS is unlayered, so it overrides the library's layered rules cleanly. */
67
258
  [data-ui="minimal-saas"][data-theme="arctic-indigo"] {
68
259
  --saas-radius-md: 1rem;
69
- --saas-primary-rgb: 72 91 255;
260
+ --saas-font-sans: Inter, system-ui, sans-serif;
261
+ --saas-font-display: Inter, system-ui, sans-serif;
262
+ }
263
+
264
+ :where([data-ui][data-theme="arctic-indigo"][data-mode="light"]) {
265
+ --usk-primary-rgb: 72 91 255;
266
+ --usk-primary-hover-rgb: 55 75 230;
267
+ --usk-primary-text-rgb: 255 255 255;
70
268
  }
71
269
  ```
270
+
271
+ ## 2.x compatibility notes
272
+
273
+ - Component-facing prefixed tokens remain available.
274
+ - Concrete color authoring moved to `--usk-*` shared roles.
275
+ - Bundled CSS inlines `theme-colors.css`; standalone style files import it.
276
+ - If a consumer build system ignores CSS `@import`, import `ui-style-kit-css/theme-colors.css` before the standalone style file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-style-kit-css",
3
- "version": "1.2.2",
3
+ "version": "2.0.2",
4
4
  "description": "CSS theme and UI style preset library for accessible websites, dashboards, admin interfaces, and client-facing pages.",
5
5
  "style": "dist/ui-style-kit.css",
6
6
  "main": "dist/ui-style-kit.css",
@@ -61,6 +61,14 @@
61
61
  "./dist/ui-style-kit.css": "./dist/ui-style-kit.css",
62
62
  "./dist/ui-style-kit.min.css": "./dist/ui-style-kit.min.css",
63
63
  "./package.json": "./package.json",
64
+ "./styles/theme-colors": "./styles/theme-colors.css",
65
+ "./styles/theme-colors.css": "./styles/theme-colors.css",
66
+ "./theme-colors": "./styles/theme-colors.css",
67
+ "./theme-colors.css": "./styles/theme-colors.css",
68
+ "./styles/native-elements": "./styles/native-elements.css",
69
+ "./styles/native-elements.css": "./styles/native-elements.css",
70
+ "./native-elements": "./styles/native-elements.css",
71
+ "./native-elements.css": "./styles/native-elements.css",
64
72
  "./styles/minimal-saas": "./styles/minimal-saas.css",
65
73
  "./styles/minimal-saas.css": "./styles/minimal-saas.css",
66
74
  "./minimal-saas": "./styles/minimal-saas.css",
@@ -108,7 +116,11 @@
108
116
  "./styles/interactive-surface-bridge": "./styles/interactive-surface-bridge.css",
109
117
  "./styles/interactive-surface-bridge.css": "./styles/interactive-surface-bridge.css",
110
118
  "./interactive-surface-bridge": "./styles/interactive-surface-bridge.css",
111
- "./interactive-surface-bridge.css": "./styles/interactive-surface-bridge.css"
119
+ "./interactive-surface-bridge.css": "./styles/interactive-surface-bridge.css",
120
+ "./with-bridge": "./dist/ui-style-kit.with-bridge.css",
121
+ "./with-bridge.css": "./dist/ui-style-kit.with-bridge.css",
122
+ "./dist/ui-style-kit.with-bridge.css": "./dist/ui-style-kit.with-bridge.css",
123
+ "./dist/ui-style-kit.with-bridge.min.css": "./dist/ui-style-kit.with-bridge.min.css"
112
124
  },
113
125
  "repository": {
114
126
  "type": "git",
@@ -123,8 +135,8 @@
123
135
  },
124
136
  "type": "module",
125
137
  "devDependencies": {
126
- "@playwright/test": "^1.60.0",
127
- "stylelint": "^17.12.0"
138
+ "@playwright/test": "~1.61.1",
139
+ "stylelint": "~17.14.0"
128
140
  },
129
141
  "scripts": {
130
142
  "build": "node scripts/build.mjs",
@@ -132,7 +144,7 @@
132
144
  "check:contrast": "node scripts/check-contrast.mjs",
133
145
  "check:package": "node scripts/check-package.mjs",
134
146
  "test": "npm run test:unit",
135
- "test:unit": "node --test tests/package-integrity.test.js",
147
+ "test:unit": "node --test tests/*.test.js",
136
148
  "test:e2e": "playwright test --config playwright.config.js",
137
149
  "test:e2e:install:ci": "playwright install --with-deps chromium",
138
150
  "check": "npm run build && npm run lint && npm run test:unit && npm run check:contrast && npm run check:package",