@atom63/styles 0.1.0-beta.6 → 0.1.0-beta.7
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/README.md +2 -2
- package/generated/atom63.figma-sync.json +8730 -4811
- package/generated/atom63.tokens.json +4017 -1769
- package/package.json +4 -2
- package/src/compat/shadcn.browser.test.ts +23 -0
- package/src/compat/shadcn.css +118 -16
- package/src/contracts/badge.css +81 -65
- package/src/contracts/badge.resolver.json +145 -62
- package/src/tailwind/roles.json +172 -0
- package/src/tailwind/theme.css +107 -21
- package/src/tokens/brand-action.css +12 -1
- package/src/tokens/brand-action.resolver.json +26 -7
- package/src/tokens/contrast.browser.test.ts +35 -0
- package/src/tokens/figma-parity.browser.test.ts +27 -14
- package/src/tokens/semantics.css +152 -4
- package/src/tokens/semantics.resolver.json +906 -12
- package/src/tokens/swift-parity.browser.test.ts +4 -0
package/src/tailwind/theme.css
CHANGED
|
@@ -340,39 +340,125 @@
|
|
|
340
340
|
--surface-light-9: var(--surface-light-9);
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
/*
|
|
343
|
+
/* Semantic roles — generated from src/tailwind/roles.json by scripts/generate-role-bridges.mjs; do not edit. */
|
|
344
344
|
@theme inline {
|
|
345
|
-
--color-accent: var(--a63-surface-control-hover);
|
|
346
|
-
--color-accent-foreground: var(--a63-text-primary);
|
|
347
345
|
--color-background: var(--a63-surface-page);
|
|
348
|
-
--color-
|
|
346
|
+
--color-foreground: var(--a63-text-primary);
|
|
349
347
|
--color-card: var(--a63-surface-panel);
|
|
350
348
|
--color-card-foreground: var(--a63-text-primary);
|
|
351
|
-
--color-dark: var(--surface-dark-1);
|
|
352
|
-
--color-destructive: var(--a63-action-danger);
|
|
353
|
-
--color-foreground: var(--a63-text-primary);
|
|
354
|
-
--color-info: var(--a63-status-info);
|
|
355
|
-
--color-input: var(--a63-border-control);
|
|
356
|
-
--color-light: var(--surface-light-1);
|
|
357
|
-
--color-muted: var(--a63-surface-muted);
|
|
358
|
-
--color-muted-foreground: var(--a63-text-secondary);
|
|
359
349
|
--color-popover: var(--a63-surface-overlay);
|
|
360
350
|
--color-popover-foreground: var(--a63-text-primary);
|
|
361
|
-
--color-
|
|
362
|
-
--color-
|
|
363
|
-
--color-ring: var(--a63-focus-ring);
|
|
351
|
+
--color-muted: var(--a63-surface-muted);
|
|
352
|
+
--color-muted-foreground: var(--a63-text-secondary);
|
|
364
353
|
--color-secondary: var(--a63-surface-muted);
|
|
365
354
|
--color-secondary-foreground: var(--a63-text-secondary);
|
|
366
|
-
--color-
|
|
367
|
-
--color-
|
|
368
|
-
--color-
|
|
369
|
-
--color-
|
|
355
|
+
--color-accent: var(--a63-surface-control-hover);
|
|
356
|
+
--color-accent-foreground: var(--a63-text-primary);
|
|
357
|
+
--color-surface-sunken: var(--a63-surface-control);
|
|
358
|
+
--color-border: var(--a63-border-subtle);
|
|
359
|
+
--color-input: var(--a63-border-control);
|
|
360
|
+
--color-ring: var(--a63-focus-ring);
|
|
361
|
+
--color-primary: var(--a63-action-primary);
|
|
362
|
+
--color-primary-foreground: var(--a63-action-primary-foreground);
|
|
363
|
+
--color-destructive: var(--a63-action-danger);
|
|
364
|
+
--color-destructive-foreground: var(--a63-action-danger-foreground);
|
|
365
|
+
--color-info: var(--a63-status-info);
|
|
366
|
+
--color-info-foreground: var(--a63-status-info-foreground);
|
|
367
|
+
--color-success: var(--a63-status-success);
|
|
368
|
+
--color-success-foreground: var(--a63-status-success-foreground);
|
|
369
|
+
--color-warning: var(--a63-status-warning);
|
|
370
|
+
--color-warning-foreground: var(--a63-status-warning-foreground);
|
|
371
|
+
--color-destructive-subtle: var(--a63-action-danger-subtle);
|
|
372
|
+
--color-destructive-subtle-foreground: var(--a63-action-danger-subtle-foreground);
|
|
373
|
+
--color-info-subtle: var(--a63-status-info-subtle);
|
|
374
|
+
--color-info-subtle-foreground: var(--a63-status-info-subtle-foreground);
|
|
375
|
+
--color-success-subtle: var(--a63-status-success-subtle);
|
|
376
|
+
--color-success-subtle-foreground: var(--a63-status-success-subtle-foreground);
|
|
377
|
+
--color-warning-subtle: var(--a63-status-warning-subtle);
|
|
378
|
+
--color-warning-subtle-foreground: var(--a63-status-warning-subtle-foreground);
|
|
379
|
+
--color-selected: var(--a63-selected-background);
|
|
380
|
+
--color-selected-foreground: var(--a63-selected-foreground);
|
|
381
|
+
--color-chart-1: var(--a63-chart-1);
|
|
382
|
+
--color-chart-2: var(--a63-chart-2);
|
|
383
|
+
--color-chart-3: var(--a63-chart-3);
|
|
384
|
+
--color-chart-4: var(--a63-chart-4);
|
|
385
|
+
--color-chart-5: var(--a63-chart-5);
|
|
386
|
+
--color-category-red: var(--a63-category-red);
|
|
387
|
+
--color-category-red-subtle: var(--a63-category-red-subtle);
|
|
388
|
+
--color-category-red-subtle-foreground: var(--a63-category-red-subtle-foreground);
|
|
389
|
+
--color-category-orange: var(--a63-category-orange);
|
|
390
|
+
--color-category-orange-subtle: var(--a63-category-orange-subtle);
|
|
391
|
+
--color-category-orange-subtle-foreground: var(--a63-category-orange-subtle-foreground);
|
|
392
|
+
--color-category-amber: var(--a63-category-amber);
|
|
393
|
+
--color-category-amber-subtle: var(--a63-category-amber-subtle);
|
|
394
|
+
--color-category-amber-subtle-foreground: var(--a63-category-amber-subtle-foreground);
|
|
395
|
+
--color-category-yellow: var(--a63-category-yellow);
|
|
396
|
+
--color-category-yellow-subtle: var(--a63-category-yellow-subtle);
|
|
397
|
+
--color-category-yellow-subtle-foreground: var(--a63-category-yellow-subtle-foreground);
|
|
398
|
+
--color-category-lime: var(--a63-category-lime);
|
|
399
|
+
--color-category-lime-subtle: var(--a63-category-lime-subtle);
|
|
400
|
+
--color-category-lime-subtle-foreground: var(--a63-category-lime-subtle-foreground);
|
|
401
|
+
--color-category-green: var(--a63-category-green);
|
|
402
|
+
--color-category-green-subtle: var(--a63-category-green-subtle);
|
|
403
|
+
--color-category-green-subtle-foreground: var(--a63-category-green-subtle-foreground);
|
|
404
|
+
--color-category-emerald: var(--a63-category-emerald);
|
|
405
|
+
--color-category-emerald-subtle: var(--a63-category-emerald-subtle);
|
|
406
|
+
--color-category-emerald-subtle-foreground: var(--a63-category-emerald-subtle-foreground);
|
|
407
|
+
--color-category-teal: var(--a63-category-teal);
|
|
408
|
+
--color-category-teal-subtle: var(--a63-category-teal-subtle);
|
|
409
|
+
--color-category-teal-subtle-foreground: var(--a63-category-teal-subtle-foreground);
|
|
410
|
+
--color-category-cyan: var(--a63-category-cyan);
|
|
411
|
+
--color-category-cyan-subtle: var(--a63-category-cyan-subtle);
|
|
412
|
+
--color-category-cyan-subtle-foreground: var(--a63-category-cyan-subtle-foreground);
|
|
413
|
+
--color-category-sky: var(--a63-category-sky);
|
|
414
|
+
--color-category-sky-subtle: var(--a63-category-sky-subtle);
|
|
415
|
+
--color-category-sky-subtle-foreground: var(--a63-category-sky-subtle-foreground);
|
|
416
|
+
--color-category-blue: var(--a63-category-blue);
|
|
417
|
+
--color-category-blue-subtle: var(--a63-category-blue-subtle);
|
|
418
|
+
--color-category-blue-subtle-foreground: var(--a63-category-blue-subtle-foreground);
|
|
419
|
+
--color-category-indigo: var(--a63-category-indigo);
|
|
420
|
+
--color-category-indigo-subtle: var(--a63-category-indigo-subtle);
|
|
421
|
+
--color-category-indigo-subtle-foreground: var(--a63-category-indigo-subtle-foreground);
|
|
422
|
+
--color-category-violet: var(--a63-category-violet);
|
|
423
|
+
--color-category-violet-subtle: var(--a63-category-violet-subtle);
|
|
424
|
+
--color-category-violet-subtle-foreground: var(--a63-category-violet-subtle-foreground);
|
|
425
|
+
--color-category-purple: var(--a63-category-purple);
|
|
426
|
+
--color-category-purple-subtle: var(--a63-category-purple-subtle);
|
|
427
|
+
--color-category-purple-subtle-foreground: var(--a63-category-purple-subtle-foreground);
|
|
428
|
+
--color-category-fuchsia: var(--a63-category-fuchsia);
|
|
429
|
+
--color-category-fuchsia-subtle: var(--a63-category-fuchsia-subtle);
|
|
430
|
+
--color-category-fuchsia-subtle-foreground: var(--a63-category-fuchsia-subtle-foreground);
|
|
431
|
+
--color-category-pink: var(--a63-category-pink);
|
|
432
|
+
--color-category-pink-subtle: var(--a63-category-pink-subtle);
|
|
433
|
+
--color-category-pink-subtle-foreground: var(--a63-category-pink-subtle-foreground);
|
|
434
|
+
--color-category-rose: var(--a63-category-rose);
|
|
435
|
+
--color-category-rose-subtle: var(--a63-category-rose-subtle);
|
|
436
|
+
--color-category-rose-subtle-foreground: var(--a63-category-rose-subtle-foreground);
|
|
437
|
+
--color-category-slate: var(--a63-category-slate);
|
|
438
|
+
--color-category-slate-subtle: var(--a63-category-slate-subtle);
|
|
439
|
+
--color-category-slate-subtle-foreground: var(--a63-category-slate-subtle-foreground);
|
|
440
|
+
--color-category-gray: var(--a63-category-gray);
|
|
441
|
+
--color-category-gray-subtle: var(--a63-category-gray-subtle);
|
|
442
|
+
--color-category-gray-subtle-foreground: var(--a63-category-gray-subtle-foreground);
|
|
443
|
+
--color-category-zinc: var(--a63-category-zinc);
|
|
444
|
+
--color-category-zinc-subtle: var(--a63-category-zinc-subtle);
|
|
445
|
+
--color-category-zinc-subtle-foreground: var(--a63-category-zinc-subtle-foreground);
|
|
446
|
+
--color-category-neutral: var(--a63-category-neutral);
|
|
447
|
+
--color-category-neutral-subtle: var(--a63-category-neutral-subtle);
|
|
448
|
+
--color-category-neutral-subtle-foreground: var(--a63-category-neutral-subtle-foreground);
|
|
449
|
+
--color-category-stone: var(--a63-category-stone);
|
|
450
|
+
--color-category-stone-subtle: var(--a63-category-stone-subtle);
|
|
451
|
+
--color-category-stone-subtle-foreground: var(--a63-category-stone-subtle-foreground);
|
|
452
|
+
--color-sidebar: var(--a63-surface-sidebar);
|
|
370
453
|
--color-sidebar-foreground: var(--a63-text-primary);
|
|
371
454
|
--color-sidebar-primary: var(--a63-action-primary);
|
|
372
455
|
--color-sidebar-primary-foreground: var(--a63-action-primary-foreground);
|
|
456
|
+
--color-sidebar-accent: var(--a63-surface-control-hover);
|
|
457
|
+
--color-sidebar-accent-foreground: var(--a63-text-primary);
|
|
458
|
+
--color-sidebar-border: var(--a63-border-subtle);
|
|
373
459
|
--color-sidebar-ring: var(--a63-focus-ring);
|
|
374
|
-
--color-
|
|
375
|
-
--color-
|
|
460
|
+
--color-light: var(--surface-light-1);
|
|
461
|
+
--color-dark: var(--surface-dark-1);
|
|
376
462
|
}
|
|
377
463
|
|
|
378
464
|
/* tokens/foundation/effects.css */
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
--a63-action-primary-text-shadow: none;
|
|
33
33
|
/* The brand as text on light surfaces (semantics.css --a63-text-accent). */
|
|
34
34
|
--a63-brand-text: var(--a63-brand-600);
|
|
35
|
-
--a63-focus-ring: color-mix(in oklch, var(--a63-brand-500) 30%, transparent);
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
[data-a63-brand='b3'] {
|
|
@@ -48,3 +47,15 @@
|
|
|
48
47
|
text on the lightly tinted Aqua page is just under 4.5:1. */
|
|
49
48
|
--a63-brand-text: var(--a63-brand-700);
|
|
50
49
|
}
|
|
50
|
+
|
|
51
|
+
[data-a63-brand='b4'] {
|
|
52
|
+
/* Pink (b4) keeps 600 for fills, but its 600 as text on the selected wash over
|
|
53
|
+
the Aqua page sits at 4.5:1 exactly. */
|
|
54
|
+
--a63-brand-text: var(--a63-brand-700);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[data-a63-brand='b6'] {
|
|
58
|
+
/* Red (b6) keeps 600 for fills, but its 600 as text on the selected wash is
|
|
59
|
+
about 4.1–4.5:1 in light mode. */
|
|
60
|
+
--a63-brand-text: var(--a63-brand-700);
|
|
61
|
+
}
|
|
@@ -38,13 +38,6 @@
|
|
|
38
38
|
"$value": "{a63.brand.600}",
|
|
39
39
|
"$description": "The brand as text on light surfaces (semantics.css --a63-text-accent)."
|
|
40
40
|
}
|
|
41
|
-
},
|
|
42
|
-
"focus-ring": {
|
|
43
|
-
"$type": "color",
|
|
44
|
-
"$value": "{a63.brand.500}",
|
|
45
|
-
"$extensions": {
|
|
46
|
-
"io.atom63.derive": "color-mix(in oklch, {a63.brand.500} 30%, transparent)"
|
|
47
|
-
}
|
|
48
41
|
}
|
|
49
42
|
}
|
|
50
43
|
}
|
|
@@ -98,6 +91,32 @@
|
|
|
98
91
|
}
|
|
99
92
|
}
|
|
100
93
|
}
|
|
94
|
+
],
|
|
95
|
+
"b4": [
|
|
96
|
+
{
|
|
97
|
+
"a63": {
|
|
98
|
+
"brand": {
|
|
99
|
+
"text": {
|
|
100
|
+
"$type": "color",
|
|
101
|
+
"$value": "{a63.brand.700}",
|
|
102
|
+
"$description": "Pink (b4) keeps 600 for fills, but its 600 as text on the selected wash over\nthe Aqua page sits at 4.5:1 exactly."
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"b6": [
|
|
109
|
+
{
|
|
110
|
+
"a63": {
|
|
111
|
+
"brand": {
|
|
112
|
+
"text": {
|
|
113
|
+
"$type": "color",
|
|
114
|
+
"$value": "{a63.brand.700}",
|
|
115
|
+
"$description": "Red (b6) keeps 600 for fills, but its 600 as text on the selected wash is\nabout 4.1–4.5:1 in light mode."
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
101
120
|
]
|
|
102
121
|
}
|
|
103
122
|
}
|
|
@@ -154,6 +154,11 @@ const brands = ['b1', 'b2', 'b3', 'b4', 'b5', 'b6'] as const
|
|
|
154
154
|
const brandPairs = [
|
|
155
155
|
{ fg: '--a63-action-primary-foreground', bg: '--a63-action-primary', min: AA_TEXT },
|
|
156
156
|
{ fg: '--a63-text-accent', bg: '--a63-surface-page', min: AA_TEXT },
|
|
157
|
+
// WCAG 1.4.11: a focus ring is the graphic that shows focus, so it reaches 3:1
|
|
158
|
+
// against the field it surrounds and the page around it.
|
|
159
|
+
{ fg: '--a63-focus-ring', bg: '--a63-surface-page', min: AA_UI },
|
|
160
|
+
{ fg: '--a63-focus-ring', bg: '--a63-surface-panel', min: AA_UI },
|
|
161
|
+
{ fg: '--a63-focus-ring', bg: '--a63-surface-control', min: AA_UI },
|
|
157
162
|
] as const
|
|
158
163
|
|
|
159
164
|
describe('brand contrast (WCAG AA)', () => {
|
|
@@ -181,4 +186,34 @@ describe('brand contrast (WCAG AA)', () => {
|
|
|
181
186
|
}
|
|
182
187
|
expect(failures, failures.join('\n')).toEqual([])
|
|
183
188
|
})
|
|
189
|
+
|
|
190
|
+
it('keeps a selected item readable on every brand ramp', () => {
|
|
191
|
+
const failures: string[] = []
|
|
192
|
+
for (const brand of brands) {
|
|
193
|
+
root().setAttribute('data-a63-brand', brand)
|
|
194
|
+
for (const theme of themes) {
|
|
195
|
+
for (const mode of modes) {
|
|
196
|
+
applyThemeMode(theme, mode)
|
|
197
|
+
// The selected wash is translucent: paint it over the page first.
|
|
198
|
+
const page = parseCssColor(resolvePaintedColor('--a63-surface-page', 'background'))
|
|
199
|
+
const washCss = resolvePaintedColor('--a63-selected-background', 'background')
|
|
200
|
+
const wash = parseCssColor(washCss)
|
|
201
|
+
const fill: Rgb = {
|
|
202
|
+
r: wash.r * wash.a + page.r * (1 - wash.a),
|
|
203
|
+
g: wash.g * wash.a + page.g * (1 - wash.a),
|
|
204
|
+
b: wash.b * wash.a + page.b * (1 - wash.a),
|
|
205
|
+
a: 1,
|
|
206
|
+
}
|
|
207
|
+
const fgCss = resolvePaintedColor('--a63-selected-foreground', 'color')
|
|
208
|
+
const ratio = contrastRatio(parseCssColor(fgCss), fill)
|
|
209
|
+
if (ratio < AA_TEXT) {
|
|
210
|
+
failures.push(
|
|
211
|
+
`${brand} ${theme}/${mode} selected: ${ratio.toFixed(2)}:1 < ${AA_TEXT}:1 (fg=${fgCss}, bg=${washCss})`
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
expect(failures, failures.join('\n')).toEqual([])
|
|
218
|
+
})
|
|
184
219
|
})
|
|
@@ -20,7 +20,11 @@ import { resetRoot, root } from '../test/apply-styles'
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
type Rgba = { r: number; g: number; b: number; a: number }
|
|
23
|
-
type Value = {
|
|
23
|
+
type Value = {
|
|
24
|
+
alias?: string
|
|
25
|
+
composed?: { alias: string; opacity: number }
|
|
26
|
+
value?: Rgba | number | string
|
|
27
|
+
}
|
|
24
28
|
interface Variable {
|
|
25
29
|
name: string
|
|
26
30
|
token: string
|
|
@@ -74,27 +78,28 @@ const defaults: Context = {
|
|
|
74
78
|
|
|
75
79
|
// Which context key picks the mode of each axis collection.
|
|
76
80
|
const collectionAxis: Record<string, keyof Context> = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
'
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
'
|
|
85
|
-
|
|
86
|
-
'
|
|
81
|
+
Mode: 'mode',
|
|
82
|
+
Brand: 'brand',
|
|
83
|
+
Surface: 'surface',
|
|
84
|
+
'Design Language': 'designLanguage',
|
|
85
|
+
Input: 'input',
|
|
86
|
+
Density: 'density',
|
|
87
|
+
Radius: 'radius',
|
|
88
|
+
'Type Scale': 'typeScale',
|
|
89
|
+
Font: 'font',
|
|
90
|
+
'Window Size': 'windowSize',
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
function modeOf(collection: Collection, context: Context): string {
|
|
90
|
-
if (collection.name === '
|
|
94
|
+
if (collection.name === 'Theme') return `${context.theme}-${context.mode}`
|
|
91
95
|
const axis = collectionAxis[collection.name]
|
|
92
96
|
return axis ? context[axis] : collection.modes[0]
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
/**
|
|
96
|
-
* The value Figma shows for a token in a context, following aliases
|
|
97
|
-
* whether the chain passed through a
|
|
100
|
+
* The value Figma shows for a token in a context, following aliases (a composed
|
|
101
|
+
* color is its alias at an opacity), and whether the chain passed through a
|
|
102
|
+
* `computed` variable.
|
|
98
103
|
*/
|
|
99
104
|
function resolveInModel(
|
|
100
105
|
token: string,
|
|
@@ -109,6 +114,14 @@ function resolveInModel(
|
|
|
109
114
|
const target = resolveInModel(entry.alias, context, [...seen, token])
|
|
110
115
|
return { ...target, approximate: target.approximate || computedTokens.has(token) }
|
|
111
116
|
}
|
|
117
|
+
if (entry?.composed) {
|
|
118
|
+
const target = resolveInModel(entry.composed.alias, context, [...seen, token])
|
|
119
|
+
const color = target.value as Rgba
|
|
120
|
+
return {
|
|
121
|
+
value: { ...color, a: (color.a * entry.composed.opacity) / 100 },
|
|
122
|
+
approximate: target.approximate || computedTokens.has(token),
|
|
123
|
+
}
|
|
124
|
+
}
|
|
112
125
|
return { value: entry?.value, approximate: computedTokens.has(token) }
|
|
113
126
|
}
|
|
114
127
|
|
package/src/tokens/semantics.css
CHANGED
|
@@ -32,6 +32,54 @@
|
|
|
32
32
|
--a63-on-media-veil: var(--color-black-10);
|
|
33
33
|
/* On media — the veil over a poster while a control on it is shown. */
|
|
34
34
|
--a63-on-media-veil-strong: var(--color-black-20);
|
|
35
|
+
/* Category hues for tags, labels and charts, one per palette hue. `subtle` is a
|
|
36
|
+
14% tint of the hue for chip backgrounds, mixed in oklab so tinted neutrals render
|
|
37
|
+
alike in every engine; `subtle.foreground` is the text on that tint (step 700 or 800
|
|
38
|
+
on light surfaces, 400 on dark). Amber uses the warning ramp. */
|
|
39
|
+
--a63-category-red: var(--color-red-500);
|
|
40
|
+
--a63-category-red-subtle: color-mix(in oklab, var(--a63-category-red) 14%, transparent);
|
|
41
|
+
--a63-category-orange: var(--color-orange-500);
|
|
42
|
+
--a63-category-orange-subtle: color-mix(in oklab, var(--a63-category-orange) 14%, transparent);
|
|
43
|
+
--a63-category-amber: var(--color-warning-500);
|
|
44
|
+
--a63-category-amber-subtle: color-mix(in oklab, var(--a63-category-amber) 14%, transparent);
|
|
45
|
+
--a63-category-yellow: var(--color-yellow-500);
|
|
46
|
+
--a63-category-yellow-subtle: color-mix(in oklab, var(--a63-category-yellow) 14%, transparent);
|
|
47
|
+
--a63-category-lime: var(--color-lime-500);
|
|
48
|
+
--a63-category-lime-subtle: color-mix(in oklab, var(--a63-category-lime) 14%, transparent);
|
|
49
|
+
--a63-category-green: var(--color-green-500);
|
|
50
|
+
--a63-category-green-subtle: color-mix(in oklab, var(--a63-category-green) 14%, transparent);
|
|
51
|
+
--a63-category-emerald: var(--color-emerald-500);
|
|
52
|
+
--a63-category-emerald-subtle: color-mix(in oklab, var(--a63-category-emerald) 14%, transparent);
|
|
53
|
+
--a63-category-teal: var(--color-teal-500);
|
|
54
|
+
--a63-category-teal-subtle: color-mix(in oklab, var(--a63-category-teal) 14%, transparent);
|
|
55
|
+
--a63-category-cyan: var(--color-cyan-500);
|
|
56
|
+
--a63-category-cyan-subtle: color-mix(in oklab, var(--a63-category-cyan) 14%, transparent);
|
|
57
|
+
--a63-category-sky: var(--color-sky-500);
|
|
58
|
+
--a63-category-sky-subtle: color-mix(in oklab, var(--a63-category-sky) 14%, transparent);
|
|
59
|
+
--a63-category-blue: var(--color-blue-500);
|
|
60
|
+
--a63-category-blue-subtle: color-mix(in oklab, var(--a63-category-blue) 14%, transparent);
|
|
61
|
+
--a63-category-indigo: var(--color-indigo-500);
|
|
62
|
+
--a63-category-indigo-subtle: color-mix(in oklab, var(--a63-category-indigo) 14%, transparent);
|
|
63
|
+
--a63-category-violet: var(--color-violet-500);
|
|
64
|
+
--a63-category-violet-subtle: color-mix(in oklab, var(--a63-category-violet) 14%, transparent);
|
|
65
|
+
--a63-category-purple: var(--color-purple-500);
|
|
66
|
+
--a63-category-purple-subtle: color-mix(in oklab, var(--a63-category-purple) 14%, transparent);
|
|
67
|
+
--a63-category-fuchsia: var(--color-fuchsia-500);
|
|
68
|
+
--a63-category-fuchsia-subtle: color-mix(in oklab, var(--a63-category-fuchsia) 14%, transparent);
|
|
69
|
+
--a63-category-pink: var(--color-pink-500);
|
|
70
|
+
--a63-category-pink-subtle: color-mix(in oklab, var(--a63-category-pink) 14%, transparent);
|
|
71
|
+
--a63-category-rose: var(--color-rose-500);
|
|
72
|
+
--a63-category-rose-subtle: color-mix(in oklab, var(--a63-category-rose) 14%, transparent);
|
|
73
|
+
--a63-category-slate: var(--color-slate-500);
|
|
74
|
+
--a63-category-slate-subtle: color-mix(in oklab, var(--a63-category-slate) 14%, transparent);
|
|
75
|
+
--a63-category-gray: var(--color-gray-500);
|
|
76
|
+
--a63-category-gray-subtle: color-mix(in oklab, var(--a63-category-gray) 14%, transparent);
|
|
77
|
+
--a63-category-zinc: var(--color-zinc-500);
|
|
78
|
+
--a63-category-zinc-subtle: color-mix(in oklab, var(--a63-category-zinc) 14%, transparent);
|
|
79
|
+
--a63-category-neutral: var(--color-neutral-500);
|
|
80
|
+
--a63-category-neutral-subtle: color-mix(in oklab, var(--a63-category-neutral) 14%, transparent);
|
|
81
|
+
--a63-category-stone: var(--color-stone-500);
|
|
82
|
+
--a63-category-stone-subtle: color-mix(in oklab, var(--a63-category-stone) 14%, transparent);
|
|
35
83
|
}
|
|
36
84
|
|
|
37
85
|
:root,
|
|
@@ -79,6 +127,9 @@
|
|
|
79
127
|
),
|
|
80
128
|
transparent 20%
|
|
81
129
|
);
|
|
130
|
+
/* The sidebar surface (shadcn `sidebar`): the muted surface in light mode and
|
|
131
|
+
the page surface in dark mode. */
|
|
132
|
+
--a63-surface-sidebar: var(--a63-surface-muted);
|
|
82
133
|
/* Text */
|
|
83
134
|
--a63-text-primary: var(--surface-light-12);
|
|
84
135
|
--a63-text-secondary: var(--surface-light-11);
|
|
@@ -99,7 +150,11 @@
|
|
|
99
150
|
var(--surface-light-5) calc(100% - var(--a63-surface-tint)),
|
|
100
151
|
var(--a63-brand-400) var(--a63-surface-tint)
|
|
101
152
|
);
|
|
102
|
-
/*
|
|
153
|
+
/* The keyboard focus ring. WCAG 1.4.11 needs 3:1 against the control and the
|
|
154
|
+
page around it; step 600 reaches that on every brand's light surfaces (the
|
|
155
|
+
translucent 500 it replaced was about 1.4:1). */
|
|
156
|
+
--a63-focus-ring: var(--a63-brand-600);
|
|
157
|
+
/* Action — primary lives in tokens/brand-action.css (brand-ramp scoped).
|
|
103
158
|
Neutral = the default variant's fill; sourced from surfaces (NOT --a63-text-*)
|
|
104
159
|
so a theme can recolor text without turning the default button into a fill. */
|
|
105
160
|
--a63-action-neutral: var(--surface-light-12);
|
|
@@ -107,17 +162,70 @@
|
|
|
107
162
|
--a63-action-danger: var(--color-danger-600);
|
|
108
163
|
--a63-action-danger-hover: color-mix(in oklch, var(--a63-action-danger) 90%, transparent);
|
|
109
164
|
--a63-action-danger-foreground: white;
|
|
165
|
+
--a63-action-danger-subtle: color-mix(in oklab, var(--a63-action-danger) 14%, transparent);
|
|
166
|
+
--a63-action-danger-subtle-foreground: var(--color-danger-700);
|
|
110
167
|
/* Status (danger's status role is served by --a63-action-danger). The base is
|
|
111
168
|
the accent used for tinted callouts (bg = mix toward transparent, text/border
|
|
112
169
|
= the accent); -foreground is the text/icon color ON a SOLID status fill.
|
|
113
170
|
Step 600 on light surfaces and 500 on dark ones (the .dark block), so icons
|
|
114
171
|
drawn in the accent reach WCAG's 3:1 for graphics in both modes. */
|
|
115
172
|
--a63-status-info: var(--color-info-600);
|
|
116
|
-
|
|
173
|
+
/* Text and icons on a solid fill of this status. Same auto-contrast step as
|
|
174
|
+
the primary foreground: near-black on bright fills, near-white on dark ones. */
|
|
175
|
+
--a63-status-info-foreground: oklch(
|
|
176
|
+
from var(--a63-status-info) clamp(0.15, (0.57 - l) * 1000, 0.985) calc(c * 0.06) h
|
|
177
|
+
);
|
|
178
|
+
--a63-status-info-subtle: color-mix(in oklab, var(--a63-status-info) 14%, transparent);
|
|
179
|
+
--a63-status-info-subtle-foreground: var(--color-info-700);
|
|
117
180
|
--a63-status-success: var(--color-success-600);
|
|
118
|
-
|
|
181
|
+
/* Text and icons on a solid fill of this status. Same auto-contrast step as
|
|
182
|
+
the primary foreground: near-black on bright fills, near-white on dark ones. */
|
|
183
|
+
--a63-status-success-foreground: oklch(
|
|
184
|
+
from var(--a63-status-success) clamp(0.15, (0.57 - l) * 1000, 0.985) calc(c * 0.06) h
|
|
185
|
+
);
|
|
186
|
+
--a63-status-success-subtle: color-mix(in oklab, var(--a63-status-success) 14%, transparent);
|
|
187
|
+
--a63-status-success-subtle-foreground: var(--color-success-700);
|
|
119
188
|
--a63-status-warning: var(--color-warning-600);
|
|
120
|
-
|
|
189
|
+
/* Text and icons on a solid fill of this status. Same auto-contrast step as
|
|
190
|
+
the primary foreground: near-black on bright fills, near-white on dark ones. */
|
|
191
|
+
--a63-status-warning-foreground: oklch(
|
|
192
|
+
from var(--a63-status-warning) clamp(0.15, (0.57 - l) * 1000, 0.985) calc(c * 0.06) h
|
|
193
|
+
);
|
|
194
|
+
--a63-status-warning-subtle: color-mix(in oklab, var(--a63-status-warning) 14%, transparent);
|
|
195
|
+
--a63-status-warning-subtle-foreground: var(--color-warning-800);
|
|
196
|
+
/* Chart series colors. Series 1 is the primary; 2–5 are fixed hues that stay
|
|
197
|
+
distinct from it and from each other (500 on light surfaces, 400 on dark). */
|
|
198
|
+
--a63-chart-1: var(--a63-action-primary);
|
|
199
|
+
--a63-chart-2: var(--color-teal-500);
|
|
200
|
+
--a63-chart-3: var(--color-amber-500);
|
|
201
|
+
--a63-chart-4: var(--color-violet-500);
|
|
202
|
+
--a63-chart-5: var(--color-rose-500);
|
|
203
|
+
--a63-category-red-subtle-foreground: var(--color-red-700);
|
|
204
|
+
--a63-category-orange-subtle-foreground: var(--color-orange-800);
|
|
205
|
+
--a63-category-amber-subtle-foreground: var(--color-warning-800);
|
|
206
|
+
--a63-category-yellow-subtle-foreground: var(--color-yellow-800);
|
|
207
|
+
--a63-category-lime-subtle-foreground: var(--color-lime-800);
|
|
208
|
+
--a63-category-green-subtle-foreground: var(--color-green-800);
|
|
209
|
+
--a63-category-emerald-subtle-foreground: var(--color-emerald-800);
|
|
210
|
+
--a63-category-teal-subtle-foreground: var(--color-teal-800);
|
|
211
|
+
--a63-category-cyan-subtle-foreground: var(--color-cyan-800);
|
|
212
|
+
--a63-category-sky-subtle-foreground: var(--color-sky-700);
|
|
213
|
+
--a63-category-blue-subtle-foreground: var(--color-blue-700);
|
|
214
|
+
--a63-category-indigo-subtle-foreground: var(--color-indigo-700);
|
|
215
|
+
--a63-category-violet-subtle-foreground: var(--color-violet-700);
|
|
216
|
+
--a63-category-purple-subtle-foreground: var(--color-purple-700);
|
|
217
|
+
--a63-category-fuchsia-subtle-foreground: var(--color-fuchsia-700);
|
|
218
|
+
--a63-category-pink-subtle-foreground: var(--color-pink-700);
|
|
219
|
+
--a63-category-rose-subtle-foreground: var(--color-rose-700);
|
|
220
|
+
--a63-category-slate-subtle-foreground: var(--color-slate-700);
|
|
221
|
+
--a63-category-gray-subtle-foreground: var(--color-gray-700);
|
|
222
|
+
--a63-category-zinc-subtle-foreground: var(--color-zinc-700);
|
|
223
|
+
--a63-category-neutral-subtle-foreground: var(--color-neutral-700);
|
|
224
|
+
--a63-category-stone-subtle-foreground: var(--color-stone-700);
|
|
225
|
+
/* A selected item in a list, menu or grid: a light wash of the primary. */
|
|
226
|
+
--a63-selected-background: color-mix(in oklch, var(--a63-action-primary) 12%, transparent);
|
|
227
|
+
/* Text and icons of a selected item. */
|
|
228
|
+
--a63-selected-foreground: var(--a63-text-accent);
|
|
121
229
|
}
|
|
122
230
|
|
|
123
231
|
:is(.dark, [data-a63-mode='dark']) {
|
|
@@ -159,6 +267,7 @@
|
|
|
159
267
|
),
|
|
160
268
|
transparent 20%
|
|
161
269
|
);
|
|
270
|
+
--a63-surface-sidebar: var(--a63-surface-page);
|
|
162
271
|
--a63-text-primary: var(--surface-dark-12);
|
|
163
272
|
--a63-text-secondary: var(--surface-dark-11);
|
|
164
273
|
/* The primary fill is too dark to read as text on dark surfaces. */
|
|
@@ -176,10 +285,49 @@
|
|
|
176
285
|
var(--surface-dark-7) calc(100% - var(--a63-surface-tint)),
|
|
177
286
|
var(--a63-brand-500) var(--a63-surface-tint)
|
|
178
287
|
);
|
|
288
|
+
/* Step 400 on dark surfaces: 600 and some brands' 500 fall below 3:1 there. */
|
|
289
|
+
--a63-focus-ring: var(--a63-brand-400);
|
|
179
290
|
--a63-action-neutral: var(--surface-dark-12);
|
|
180
291
|
--a63-action-neutral-foreground: var(--surface-dark-1);
|
|
181
292
|
--a63-action-danger-hover: color-mix(in oklch, var(--a63-action-danger) 82%, white 8%);
|
|
293
|
+
--a63-action-danger-subtle: color-mix(in oklab, var(--a63-action-danger) 14%, transparent);
|
|
294
|
+
--a63-action-danger-subtle-foreground: var(--color-danger-400);
|
|
182
295
|
--a63-status-info: var(--color-info-500);
|
|
296
|
+
--a63-status-info-subtle: color-mix(in oklab, var(--a63-status-info) 14%, transparent);
|
|
297
|
+
--a63-status-info-subtle-foreground: var(--color-info-400);
|
|
183
298
|
--a63-status-success: var(--color-success-500);
|
|
299
|
+
--a63-status-success-subtle: color-mix(in oklab, var(--a63-status-success) 14%, transparent);
|
|
300
|
+
--a63-status-success-subtle-foreground: var(--color-success-400);
|
|
184
301
|
--a63-status-warning: var(--color-warning-500);
|
|
302
|
+
--a63-status-warning-subtle: color-mix(in oklab, var(--a63-status-warning) 14%, transparent);
|
|
303
|
+
--a63-status-warning-subtle-foreground: var(--color-warning-400);
|
|
304
|
+
--a63-chart-1: var(--a63-action-primary);
|
|
305
|
+
--a63-chart-2: var(--color-teal-400);
|
|
306
|
+
--a63-chart-3: var(--color-amber-400);
|
|
307
|
+
--a63-chart-4: var(--color-violet-400);
|
|
308
|
+
--a63-chart-5: var(--color-rose-400);
|
|
309
|
+
--a63-category-red-subtle-foreground: var(--color-red-400);
|
|
310
|
+
--a63-category-orange-subtle-foreground: var(--color-orange-400);
|
|
311
|
+
--a63-category-amber-subtle-foreground: var(--color-warning-400);
|
|
312
|
+
--a63-category-yellow-subtle-foreground: var(--color-yellow-400);
|
|
313
|
+
--a63-category-lime-subtle-foreground: var(--color-lime-400);
|
|
314
|
+
--a63-category-green-subtle-foreground: var(--color-green-400);
|
|
315
|
+
--a63-category-emerald-subtle-foreground: var(--color-emerald-400);
|
|
316
|
+
--a63-category-teal-subtle-foreground: var(--color-teal-400);
|
|
317
|
+
--a63-category-cyan-subtle-foreground: var(--color-cyan-400);
|
|
318
|
+
--a63-category-sky-subtle-foreground: var(--color-sky-400);
|
|
319
|
+
--a63-category-blue-subtle-foreground: var(--color-blue-400);
|
|
320
|
+
--a63-category-indigo-subtle-foreground: var(--color-indigo-400);
|
|
321
|
+
--a63-category-violet-subtle-foreground: var(--color-violet-400);
|
|
322
|
+
--a63-category-purple-subtle-foreground: var(--color-purple-400);
|
|
323
|
+
--a63-category-fuchsia-subtle-foreground: var(--color-fuchsia-400);
|
|
324
|
+
--a63-category-pink-subtle-foreground: var(--color-pink-400);
|
|
325
|
+
--a63-category-rose-subtle-foreground: var(--color-rose-400);
|
|
326
|
+
--a63-category-slate-subtle-foreground: var(--color-slate-400);
|
|
327
|
+
--a63-category-gray-subtle-foreground: var(--color-gray-400);
|
|
328
|
+
--a63-category-zinc-subtle-foreground: var(--color-zinc-400);
|
|
329
|
+
--a63-category-neutral-subtle-foreground: var(--color-neutral-400);
|
|
330
|
+
--a63-category-stone-subtle-foreground: var(--color-stone-400);
|
|
331
|
+
--a63-selected-background: color-mix(in oklch, var(--a63-action-primary) 12%, transparent);
|
|
332
|
+
--a63-selected-foreground: var(--a63-text-accent);
|
|
185
333
|
}
|