@atom63/styles 0.1.0-beta.7 → 0.1.0-beta.8
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 +5 -2
- package/generated/atom63.figma-sync.json +5303 -3801
- package/generated/atom63.tokens.json +7298 -4304
- package/package.json +3 -3
- package/src/compat/a63-from-shadcn.css +5 -1
- package/src/compat/shadcn.css +15 -1
- package/src/contracts/choice.css +1 -1
- package/src/contracts/choice.tokens.json +1 -1
- package/src/contracts/control.css +14 -8
- package/src/contracts/control.tokens.json +57 -8
- package/src/contracts/environment.css +134 -12
- package/src/contracts/environment.resolver.json +664 -23
- package/src/contracts/field.css +1 -1
- package/src/contracts/field.tokens.json +1 -1
- package/src/contracts/selection.css +2 -0
- package/src/contracts/selection.tokens.json +5 -0
- package/src/contracts/surface.css +4 -0
- package/src/contracts/surface.tokens.json +57 -0
- package/src/tailwind/roles.json +19 -2
- package/src/tailwind/theme.css +104 -2
- package/src/tailwind/utilities.css +17 -0
- package/src/themes/aqua.css +1 -0
- package/src/themes/aqua.resolver.json +6 -0
- package/src/themes/retro.css +1 -0
- package/src/themes/retro.resolver.json +6 -0
- package/src/themes/terminal.css +8 -0
- package/src/themes/terminal.resolver.json +37 -0
- package/src/tokens/brand-action.css +4 -0
- package/src/tokens/brand-action.resolver.json +18 -0
- package/src/tokens/contrast.browser.test.ts +40 -16
- package/src/tokens/density.browser.test.ts +167 -0
- package/src/tokens/form-factor.browser.test.ts +129 -0
- package/src/tokens/foundation/primitives.css +0 -30
- package/src/tokens/foundation/primitives.tokens.json +0 -212
- package/src/tokens/foundation/radius.css +5 -0
- package/src/tokens/foundation/radius.tokens.json +8 -0
- package/src/tokens/foundation/typography.css +24 -0
- package/src/tokens/foundation/typography.native.css +12 -2
- package/src/tokens/foundation/typography.resolver.json +72 -0
- package/src/tokens/index.css +1 -0
- package/src/tokens/personalization-axes.browser.test.ts +13 -0
- package/src/tokens/semantics.css +104 -5
- package/src/tokens/semantics.resolver.json +253 -11
- package/src/tokens/surface.css +8 -0
- package/src/tokens/surface.resolver.json +49 -0
- package/src/tokens/type-roles.css +75 -0
- package/src/tokens/type-roles.resolver.json +366 -0
package/src/contracts/field.css
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* mode-independent (static inset), so it's safe to declare at :root and let
|
|
15
15
|
* themes override it on their shell. The OTHER hooks resolve at the recipe
|
|
16
16
|
* use-site against mode/theme/brand-dependent semantics (--a63-surface-control,
|
|
17
|
-
* --a63-border-
|
|
17
|
+
* --a63-border-input, --a63-control-radius, --a63-focus-ring,
|
|
18
18
|
* --a63-action-primary); declaring THOSE at :root would freeze their var()s to
|
|
19
19
|
* the root's mode/theme and inherit the wrong value down — the
|
|
20
20
|
* resolve-at-declaration trap. So they stay UNSET here and the recipe reads
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$description": "Field contract — the RECESSED control (text inputs), the inset counterpart to\nthe raised control (buttons) in control.css.\n\nA field is a control: it reuses the control SIZING ramp\n(--a63-control-height/padding-inline/font-size/radius), so it inherits\ndesign-language (iOS taller) sizing for free.\n\nTheme-overridable hooks: --a63-field-{background,border,radius,shadow,\nfocus-ring,focus-border}. Only --a63-field-shadow gets a default here — it is\nmode-independent (static inset), so it's safe to declare at :root and let\nthemes override it on their shell. The OTHER hooks resolve at the recipe\nuse-site against mode/theme/brand-dependent semantics (--a63-surface-control,\n--a63-border-
|
|
2
|
+
"$description": "Field contract — the RECESSED control (text inputs), the inset counterpart to\nthe raised control (buttons) in control.css.\n\nA field is a control: it reuses the control SIZING ramp\n(--a63-control-height/padding-inline/font-size/radius), so it inherits\ndesign-language (iOS taller) sizing for free.\n\nTheme-overridable hooks: --a63-field-{background,border,radius,shadow,\nfocus-ring,focus-border}. Only --a63-field-shadow gets a default here — it is\nmode-independent (static inset), so it's safe to declare at :root and let\nthemes override it on their shell. The OTHER hooks resolve at the recipe\nuse-site against mode/theme/brand-dependent semantics (--a63-surface-control,\n--a63-border-input, --a63-control-radius, --a63-focus-ring,\n--a63-action-primary); declaring THOSE at :root would freeze their var()s to\nthe root's mode/theme and inherit the wrong value down — the\nresolve-at-declaration trap. So they stay UNSET here and the recipe reads\n`var(--a63-field-X, <semantic>)`: a theme override wins, else the live\nsemantic resolves per the field's own scope. A theme sets --a63-field-shadow\n(all four) and, where it re-skins the fill, --a63-field-background (terminal).",
|
|
3
3
|
"a63": {
|
|
4
4
|
"field": {
|
|
5
5
|
"shadow": {
|
|
@@ -20,4 +20,6 @@
|
|
|
20
20
|
--a63-selection-thumb-fg: color-mix(in oklch, black 78%, transparent);
|
|
21
21
|
/* Drives the switch track geometry; iOS enlarges it in environment.css. */
|
|
22
22
|
--a63-switch-thumb-size: 1rem;
|
|
23
|
+
/* The thumb's width over its height: 1 is a round knob. The track is the thumb plus one thumb height of travel, so a wider thumb lengthens the track. The phone form factor widens it (environment.css). */
|
|
24
|
+
--a63-switch-thumb-aspect: 1;
|
|
23
25
|
}
|
|
@@ -30,6 +30,11 @@
|
|
|
30
30
|
"unit": "rem"
|
|
31
31
|
},
|
|
32
32
|
"$description": "Drives the switch track geometry; iOS enlarges it in environment.css."
|
|
33
|
+
},
|
|
34
|
+
"aspect": {
|
|
35
|
+
"$type": "number",
|
|
36
|
+
"$value": 1,
|
|
37
|
+
"$description": "The thumb's width over its height: 1 is a round knob. The track is the thumb plus one thumb height of travel, so a wider thumb lengthens the track. The phone form factor widens it (environment.css)."
|
|
33
38
|
}
|
|
34
39
|
}
|
|
35
40
|
}
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
is only legal as the sole value — it invalidates the whole declaration and
|
|
39
39
|
silently drops the surface's elevation. */
|
|
40
40
|
--a63-surface-inner-shadow: 0 0 #0000;
|
|
41
|
+
/* Soft lift for a borderless surface that sits above its ground: the elevated Card and the raised Button. Themes point it at their own surface treatment. */
|
|
42
|
+
--a63-surface-raised-shadow:
|
|
43
|
+
0 1px 3px color-mix(in oklch, black 8%, transparent),
|
|
44
|
+
0 4px 12px -2px color-mix(in oklch, black 10%, transparent);
|
|
41
45
|
--a63-surface-highlight-opacity: 1;
|
|
42
46
|
/* Bevel controls. */
|
|
43
47
|
--a63-surface-border-style: solid;
|
|
@@ -67,6 +67,63 @@
|
|
|
67
67
|
"$description": "Recessed/inset treatment (sunken well). `0 0 #0000` = flat.\n NOT `none`: this token is composed into comma-separated box-shadow lists\n (`var(--a63-surface-inner-shadow), var(--a63-surface-shadow)`), and `none`\n is only legal as the sole value — it invalidates the whole declaration and\n silently drops the surface's elevation."
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
+
"raised": {
|
|
71
|
+
"shadow": {
|
|
72
|
+
"$type": "shadow",
|
|
73
|
+
"$value": [
|
|
74
|
+
{
|
|
75
|
+
"color": {
|
|
76
|
+
"colorSpace": "srgb",
|
|
77
|
+
"components": [0, 0, 0],
|
|
78
|
+
"alpha": 0.08
|
|
79
|
+
},
|
|
80
|
+
"offsetX": {
|
|
81
|
+
"value": 0,
|
|
82
|
+
"unit": "px"
|
|
83
|
+
},
|
|
84
|
+
"offsetY": {
|
|
85
|
+
"value": 1,
|
|
86
|
+
"unit": "px"
|
|
87
|
+
},
|
|
88
|
+
"blur": {
|
|
89
|
+
"value": 3,
|
|
90
|
+
"unit": "px"
|
|
91
|
+
},
|
|
92
|
+
"spread": {
|
|
93
|
+
"value": 0,
|
|
94
|
+
"unit": "px"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"color": {
|
|
99
|
+
"colorSpace": "srgb",
|
|
100
|
+
"components": [0, 0, 0],
|
|
101
|
+
"alpha": 0.1
|
|
102
|
+
},
|
|
103
|
+
"offsetX": {
|
|
104
|
+
"value": 0,
|
|
105
|
+
"unit": "px"
|
|
106
|
+
},
|
|
107
|
+
"offsetY": {
|
|
108
|
+
"value": 4,
|
|
109
|
+
"unit": "px"
|
|
110
|
+
},
|
|
111
|
+
"blur": {
|
|
112
|
+
"value": 12,
|
|
113
|
+
"unit": "px"
|
|
114
|
+
},
|
|
115
|
+
"spread": {
|
|
116
|
+
"value": -2,
|
|
117
|
+
"unit": "px"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"$extensions": {
|
|
122
|
+
"io.atom63.derive": "0 1px 3px color-mix(in oklch, black 8%, transparent), 0 4px 12px -2px color-mix(in oklch, black 10%, transparent)"
|
|
123
|
+
},
|
|
124
|
+
"$description": "Soft lift for a borderless surface that sits above its ground: the elevated Card and the raised Button. Themes point it at their own surface treatment."
|
|
125
|
+
}
|
|
126
|
+
},
|
|
70
127
|
"highlight": {
|
|
71
128
|
"opacity": {
|
|
72
129
|
"$type": "number",
|
package/src/tailwind/roles.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"label": "Borders and focus",
|
|
24
24
|
"roles": {
|
|
25
25
|
"border": "--a63-border-subtle",
|
|
26
|
-
"input": "--a63-border-
|
|
26
|
+
"input": "--a63-border-input",
|
|
27
27
|
"ring": "--a63-focus-ring"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
@@ -64,7 +64,9 @@
|
|
|
64
64
|
"label": "Selection",
|
|
65
65
|
"roles": {
|
|
66
66
|
"selected": "--a63-selected-background",
|
|
67
|
-
"selected-foreground": "--a63-selected-foreground"
|
|
67
|
+
"selected-foreground": "--a63-selected-foreground",
|
|
68
|
+
"selected-accent": "--a63-selected-accent-background",
|
|
69
|
+
"selected-accent-foreground": "--a63-selected-accent-foreground"
|
|
68
70
|
}
|
|
69
71
|
},
|
|
70
72
|
{
|
|
@@ -148,6 +150,21 @@
|
|
|
148
150
|
"category-stone-subtle-foreground": "--a63-category-stone-subtle-foreground"
|
|
149
151
|
}
|
|
150
152
|
},
|
|
153
|
+
{
|
|
154
|
+
"label": "Media",
|
|
155
|
+
"roles": {
|
|
156
|
+
"media-stage": "--a63-media-stage",
|
|
157
|
+
"media-surface": "--a63-media-surface",
|
|
158
|
+
"media-scrim": "--a63-media-scrim",
|
|
159
|
+
"on-media-foreground": "--a63-on-media-foreground",
|
|
160
|
+
"on-media-surface": "--a63-on-media-surface",
|
|
161
|
+
"on-media-surface-strong": "--a63-on-media-surface-strong",
|
|
162
|
+
"on-media-border": "--a63-on-media-border",
|
|
163
|
+
"on-media-ring": "--a63-on-media-ring",
|
|
164
|
+
"on-media-veil": "--a63-on-media-veil",
|
|
165
|
+
"on-media-veil-strong": "--a63-on-media-veil-strong"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
151
168
|
{
|
|
152
169
|
"label": "Sidebar",
|
|
153
170
|
"roles": {
|
package/src/tailwind/theme.css
CHANGED
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
--color-accent-foreground: var(--a63-text-primary);
|
|
357
357
|
--color-surface-sunken: var(--a63-surface-control);
|
|
358
358
|
--color-border: var(--a63-border-subtle);
|
|
359
|
-
--color-input: var(--a63-border-
|
|
359
|
+
--color-input: var(--a63-border-input);
|
|
360
360
|
--color-ring: var(--a63-focus-ring);
|
|
361
361
|
--color-primary: var(--a63-action-primary);
|
|
362
362
|
--color-primary-foreground: var(--a63-action-primary-foreground);
|
|
@@ -378,6 +378,8 @@
|
|
|
378
378
|
--color-warning-subtle-foreground: var(--a63-status-warning-subtle-foreground);
|
|
379
379
|
--color-selected: var(--a63-selected-background);
|
|
380
380
|
--color-selected-foreground: var(--a63-selected-foreground);
|
|
381
|
+
--color-selected-accent: var(--a63-selected-accent-background);
|
|
382
|
+
--color-selected-accent-foreground: var(--a63-selected-accent-foreground);
|
|
381
383
|
--color-chart-1: var(--a63-chart-1);
|
|
382
384
|
--color-chart-2: var(--a63-chart-2);
|
|
383
385
|
--color-chart-3: var(--a63-chart-3);
|
|
@@ -449,6 +451,16 @@
|
|
|
449
451
|
--color-category-stone: var(--a63-category-stone);
|
|
450
452
|
--color-category-stone-subtle: var(--a63-category-stone-subtle);
|
|
451
453
|
--color-category-stone-subtle-foreground: var(--a63-category-stone-subtle-foreground);
|
|
454
|
+
--color-media-stage: var(--a63-media-stage);
|
|
455
|
+
--color-media-surface: var(--a63-media-surface);
|
|
456
|
+
--color-media-scrim: var(--a63-media-scrim);
|
|
457
|
+
--color-on-media-foreground: var(--a63-on-media-foreground);
|
|
458
|
+
--color-on-media-surface: var(--a63-on-media-surface);
|
|
459
|
+
--color-on-media-surface-strong: var(--a63-on-media-surface-strong);
|
|
460
|
+
--color-on-media-border: var(--a63-on-media-border);
|
|
461
|
+
--color-on-media-ring: var(--a63-on-media-ring);
|
|
462
|
+
--color-on-media-veil: var(--a63-on-media-veil);
|
|
463
|
+
--color-on-media-veil-strong: var(--a63-on-media-veil-strong);
|
|
452
464
|
--color-sidebar: var(--a63-surface-sidebar);
|
|
453
465
|
--color-sidebar-foreground: var(--a63-text-primary);
|
|
454
466
|
--color-sidebar-primary: var(--a63-action-primary);
|
|
@@ -498,7 +510,13 @@
|
|
|
498
510
|
--radius-2xl: var(--radius-2xl);
|
|
499
511
|
--radius-3xl: var(--radius-3xl);
|
|
500
512
|
--radius-4xl: var(--radius-4xl);
|
|
501
|
-
--radius-
|
|
513
|
+
--radius-pill: var(--radius-pill);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
@theme inline reference {
|
|
517
|
+
/* `rounded-full` is a true circle: it draws --radius-pill. Reference-only, so
|
|
518
|
+
Tailwind does not redeclare --radius-full, which stays the soft 2× xl step. */
|
|
519
|
+
--radius-full: var(--radius-pill);
|
|
502
520
|
}
|
|
503
521
|
|
|
504
522
|
/* tokens/foundation/fonts.css */
|
|
@@ -514,6 +532,8 @@
|
|
|
514
532
|
|
|
515
533
|
@theme inline {
|
|
516
534
|
--typography-scale: 1;
|
|
535
|
+
--text-2xs: var(--typography-2xs-font-size);
|
|
536
|
+
--text-2xs--line-height: var(--typography-2xs-line-height);
|
|
517
537
|
--text-xs: var(--typography-xs-font-size);
|
|
518
538
|
--text-xs--line-height: var(--typography-xs-line-height);
|
|
519
539
|
--text-sm: var(--typography-sm-font-size);
|
|
@@ -598,3 +618,85 @@
|
|
|
598
618
|
}
|
|
599
619
|
}
|
|
600
620
|
}
|
|
621
|
+
|
|
622
|
+
/* Text roles — generated from src/tokens/type-roles.resolver.json by scripts/generate-role-bridges.mjs; do not edit. */
|
|
623
|
+
@theme inline {
|
|
624
|
+
--text-display-large: var(--a63-type-display-large-font-size);
|
|
625
|
+
--text-display-large--line-height: var(--a63-type-display-large-line-height);
|
|
626
|
+
--text-display-large--font-weight: var(--a63-type-display-large-font-weight);
|
|
627
|
+
--text-display-large-strong: var(--a63-type-display-large-font-size);
|
|
628
|
+
--text-display-large-strong--line-height: var(--a63-type-display-large-line-height);
|
|
629
|
+
--text-display-large-strong--font-weight: var(--a63-type-display-large-font-weight-strong);
|
|
630
|
+
--text-display: var(--a63-type-display-font-size);
|
|
631
|
+
--text-display--line-height: var(--a63-type-display-line-height);
|
|
632
|
+
--text-display--font-weight: var(--a63-type-display-font-weight);
|
|
633
|
+
--text-display-strong: var(--a63-type-display-font-size);
|
|
634
|
+
--text-display-strong--line-height: var(--a63-type-display-line-height);
|
|
635
|
+
--text-display-strong--font-weight: var(--a63-type-display-font-weight-strong);
|
|
636
|
+
--text-large-title: var(--a63-type-large-title-font-size);
|
|
637
|
+
--text-large-title--line-height: var(--a63-type-large-title-line-height);
|
|
638
|
+
--text-large-title--font-weight: var(--a63-type-large-title-font-weight);
|
|
639
|
+
--text-large-title-strong: var(--a63-type-large-title-font-size);
|
|
640
|
+
--text-large-title-strong--line-height: var(--a63-type-large-title-line-height);
|
|
641
|
+
--text-large-title-strong--font-weight: var(--a63-type-large-title-font-weight-strong);
|
|
642
|
+
--text-title-1: var(--a63-type-title-1-font-size);
|
|
643
|
+
--text-title-1--line-height: var(--a63-type-title-1-line-height);
|
|
644
|
+
--text-title-1--font-weight: var(--a63-type-title-1-font-weight);
|
|
645
|
+
--text-title-1-strong: var(--a63-type-title-1-font-size);
|
|
646
|
+
--text-title-1-strong--line-height: var(--a63-type-title-1-line-height);
|
|
647
|
+
--text-title-1-strong--font-weight: var(--a63-type-title-1-font-weight-strong);
|
|
648
|
+
--text-title-2: var(--a63-type-title-2-font-size);
|
|
649
|
+
--text-title-2--line-height: var(--a63-type-title-2-line-height);
|
|
650
|
+
--text-title-2--font-weight: var(--a63-type-title-2-font-weight);
|
|
651
|
+
--text-title-2-strong: var(--a63-type-title-2-font-size);
|
|
652
|
+
--text-title-2-strong--line-height: var(--a63-type-title-2-line-height);
|
|
653
|
+
--text-title-2-strong--font-weight: var(--a63-type-title-2-font-weight-strong);
|
|
654
|
+
--text-title-3: var(--a63-type-title-3-font-size);
|
|
655
|
+
--text-title-3--line-height: var(--a63-type-title-3-line-height);
|
|
656
|
+
--text-title-3--font-weight: var(--a63-type-title-3-font-weight);
|
|
657
|
+
--text-title-3-strong: var(--a63-type-title-3-font-size);
|
|
658
|
+
--text-title-3-strong--line-height: var(--a63-type-title-3-line-height);
|
|
659
|
+
--text-title-3-strong--font-weight: var(--a63-type-title-3-font-weight-strong);
|
|
660
|
+
--text-headline: var(--a63-type-headline-font-size);
|
|
661
|
+
--text-headline--line-height: var(--a63-type-headline-line-height);
|
|
662
|
+
--text-headline--font-weight: var(--a63-type-headline-font-weight);
|
|
663
|
+
--text-headline-strong: var(--a63-type-headline-font-size);
|
|
664
|
+
--text-headline-strong--line-height: var(--a63-type-headline-line-height);
|
|
665
|
+
--text-headline-strong--font-weight: var(--a63-type-headline-font-weight-strong);
|
|
666
|
+
--text-body: var(--a63-type-body-font-size);
|
|
667
|
+
--text-body--line-height: var(--a63-type-body-line-height);
|
|
668
|
+
--text-body--font-weight: var(--a63-type-body-font-weight);
|
|
669
|
+
--text-body-strong: var(--a63-type-body-font-size);
|
|
670
|
+
--text-body-strong--line-height: var(--a63-type-body-line-height);
|
|
671
|
+
--text-body-strong--font-weight: var(--a63-type-body-font-weight-strong);
|
|
672
|
+
--text-callout: var(--a63-type-callout-font-size);
|
|
673
|
+
--text-callout--line-height: var(--a63-type-callout-line-height);
|
|
674
|
+
--text-callout--font-weight: var(--a63-type-callout-font-weight);
|
|
675
|
+
--text-callout-strong: var(--a63-type-callout-font-size);
|
|
676
|
+
--text-callout-strong--line-height: var(--a63-type-callout-line-height);
|
|
677
|
+
--text-callout-strong--font-weight: var(--a63-type-callout-font-weight-strong);
|
|
678
|
+
--text-subhead: var(--a63-type-subhead-font-size);
|
|
679
|
+
--text-subhead--line-height: var(--a63-type-subhead-line-height);
|
|
680
|
+
--text-subhead--font-weight: var(--a63-type-subhead-font-weight);
|
|
681
|
+
--text-subhead-strong: var(--a63-type-subhead-font-size);
|
|
682
|
+
--text-subhead-strong--line-height: var(--a63-type-subhead-line-height);
|
|
683
|
+
--text-subhead-strong--font-weight: var(--a63-type-subhead-font-weight-strong);
|
|
684
|
+
--text-footnote: var(--a63-type-footnote-font-size);
|
|
685
|
+
--text-footnote--line-height: var(--a63-type-footnote-line-height);
|
|
686
|
+
--text-footnote--font-weight: var(--a63-type-footnote-font-weight);
|
|
687
|
+
--text-footnote-strong: var(--a63-type-footnote-font-size);
|
|
688
|
+
--text-footnote-strong--line-height: var(--a63-type-footnote-line-height);
|
|
689
|
+
--text-footnote-strong--font-weight: var(--a63-type-footnote-font-weight-strong);
|
|
690
|
+
--text-caption-1: var(--a63-type-caption-1-font-size);
|
|
691
|
+
--text-caption-1--line-height: var(--a63-type-caption-1-line-height);
|
|
692
|
+
--text-caption-1--font-weight: var(--a63-type-caption-1-font-weight);
|
|
693
|
+
--text-caption-1-strong: var(--a63-type-caption-1-font-size);
|
|
694
|
+
--text-caption-1-strong--line-height: var(--a63-type-caption-1-line-height);
|
|
695
|
+
--text-caption-1-strong--font-weight: var(--a63-type-caption-1-font-weight-strong);
|
|
696
|
+
--text-caption-2: var(--a63-type-caption-2-font-size);
|
|
697
|
+
--text-caption-2--line-height: var(--a63-type-caption-2-line-height);
|
|
698
|
+
--text-caption-2--font-weight: var(--a63-type-caption-2-font-weight);
|
|
699
|
+
--text-caption-2-strong: var(--a63-type-caption-2-font-size);
|
|
700
|
+
--text-caption-2-strong--line-height: var(--a63-type-caption-2-line-height);
|
|
701
|
+
--text-caption-2-strong--font-weight: var(--a63-type-caption-2-font-weight-strong);
|
|
702
|
+
}
|
|
@@ -39,3 +39,20 @@
|
|
|
39
39
|
--scroll-mask-fade-from-r: --value(percentage);
|
|
40
40
|
--scroll-mask-fade-from-r: --value([length], [percentage]);
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
/* The fraction of a display amount ("$13.25" with ".25" small and raised), as
|
|
44
|
+
banking and pricing screens draw balances. Wrap the fraction in it and keep the
|
|
45
|
+
whole amount in one text-display span with tabular-nums. */
|
|
46
|
+
@utility amount-fraction {
|
|
47
|
+
font-size: 0.5em;
|
|
48
|
+
line-height: 0;
|
|
49
|
+
vertical-align: 0.8em;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* The same fraction kept on the baseline of the integer digits ("$13.25" with
|
|
53
|
+
".25" small and level with the bottom of "13"), as some banking apps draw a balance. */
|
|
54
|
+
@utility amount-fraction-baseline {
|
|
55
|
+
font-size: 0.5em;
|
|
56
|
+
line-height: 0;
|
|
57
|
+
vertical-align: baseline;
|
|
58
|
+
}
|
package/src/themes/aqua.css
CHANGED
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
--a63-surface-backdrop: saturate(1.4) blur(var(--blur-lg));
|
|
57
57
|
--a63-surface-highlight: color-mix(in oklch, white 55%, transparent);
|
|
58
58
|
--a63-surface-highlight-opacity: 0.75;
|
|
59
|
+
--a63-surface-raised-shadow: var(--a63-surface-shadow);
|
|
59
60
|
/* Menus need a quieter, more even backplate than larger Aqua overlays so
|
|
60
61
|
dense rows remain legible from top to bottom. */
|
|
61
62
|
--a63-menu-popup-background: color-mix(in oklab, var(--a63-surface-overlay) 92%, white);
|
package/src/themes/retro.css
CHANGED
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
square corners via the radius personalization axis (not hardcoded here). */
|
|
60
60
|
--a63-surface-border-style: outset;
|
|
61
61
|
--a63-surface-border-width: 2px;
|
|
62
|
+
--a63-surface-raised-shadow: var(--a63-surface-shadow);
|
|
62
63
|
--a63-track-shadow:
|
|
63
64
|
inset 1px 1px 0 color-mix(in oklch, black 22%, transparent),
|
|
64
65
|
inset -1px -1px 0 color-mix(in oklch, white 40%, transparent);
|
package/src/themes/terminal.css
CHANGED
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
transparent 1px,
|
|
62
62
|
transparent 3px
|
|
63
63
|
);
|
|
64
|
+
--a63-surface-raised-shadow: var(--a63-surface-shadow);
|
|
64
65
|
--a63-track-shadow: inset 0 0 4px -1px
|
|
65
66
|
color-mix(in oklch, var(--a63-action-primary) 22%, transparent);
|
|
66
67
|
--a63-choice-box-shadow: inset 0 0 5px -2px
|
|
@@ -94,11 +95,15 @@
|
|
|
94
95
|
/* Darker phosphor ink on paper — pure brand-500 fails AA on near-white page. */
|
|
95
96
|
--a63-text-primary: color-mix(in oklch, var(--a63-action-primary) 70%, black);
|
|
96
97
|
--a63-text-secondary: color-mix(in oklch, var(--a63-action-primary) 52%, black);
|
|
98
|
+
/* Placeholders and meta: a lighter phosphor ink on paper, still AA 4.5:1. */
|
|
99
|
+
--a63-text-tertiary: color-mix(in oklch, var(--a63-action-primary) 80%, black);
|
|
97
100
|
--a63-border-control: color-mix(
|
|
98
101
|
in oklab,
|
|
99
102
|
var(--a63-action-primary) 26%,
|
|
100
103
|
color-mix(in oklab, var(--surface-light-5) 60%, white)
|
|
101
104
|
);
|
|
105
|
+
/* Phosphor form-control border: 3:1 against the tinted page, panel and field fill. */
|
|
106
|
+
--a63-border-input: color-mix(in oklab, var(--a63-action-primary) 70%, var(--surface-light-10));
|
|
102
107
|
--a63-border-subtle: color-mix(
|
|
103
108
|
in oklab,
|
|
104
109
|
var(--a63-action-primary) 16%,
|
|
@@ -146,7 +151,10 @@
|
|
|
146
151
|
--a63-text-primary: color-mix(in oklch, var(--a63-action-primary) 62%, white);
|
|
147
152
|
/* Text mixes read the brand-as-text token; the primary fill is too dark here. */
|
|
148
153
|
--a63-text-secondary: color-mix(in oklab, var(--a63-text-accent) 48%, var(--surface-dark-11));
|
|
154
|
+
/* Placeholders and meta: a dimmer phosphor than secondary, still AA 4.5:1. */
|
|
155
|
+
--a63-text-tertiary: color-mix(in oklab, var(--a63-text-accent) 40%, var(--surface-dark-10));
|
|
149
156
|
--a63-border-control: color-mix(in oklch, var(--a63-action-primary) 42%, transparent);
|
|
157
|
+
--a63-border-input: color-mix(in oklch, var(--a63-text-accent) 60%, transparent);
|
|
150
158
|
--a63-border-subtle: color-mix(in oklch, var(--a63-action-primary) 22%, transparent);
|
|
151
159
|
--a63-surface-page: color-mix(in oklab, var(--surface-dark-1) 92%, var(--a63-action-primary));
|
|
152
160
|
--a63-surface-panel: color-mix(in oklab, var(--surface-dark-2) 92%, var(--a63-action-primary));
|
|
@@ -111,6 +111,12 @@
|
|
|
111
111
|
},
|
|
112
112
|
"$description": "Terminal surfaces/overlays get a faint CRT scanline texture. Square look\n comes from the radius personalization axis, not hardcoded radii here."
|
|
113
113
|
}
|
|
114
|
+
},
|
|
115
|
+
"raised": {
|
|
116
|
+
"shadow": {
|
|
117
|
+
"$type": "shadow",
|
|
118
|
+
"$value": "{a63.surface.shadow}"
|
|
119
|
+
}
|
|
114
120
|
}
|
|
115
121
|
},
|
|
116
122
|
"track": {
|
|
@@ -236,6 +242,14 @@
|
|
|
236
242
|
"$extensions": {
|
|
237
243
|
"io.atom63.derive": "color-mix(in oklch, {a63.action.primary} 52%, black)"
|
|
238
244
|
}
|
|
245
|
+
},
|
|
246
|
+
"tertiary": {
|
|
247
|
+
"$type": "color",
|
|
248
|
+
"$value": "{a63.action.primary}",
|
|
249
|
+
"$extensions": {
|
|
250
|
+
"io.atom63.derive": "color-mix(in oklch, {a63.action.primary} 80%, black)"
|
|
251
|
+
},
|
|
252
|
+
"$description": "Placeholders and meta: a lighter phosphor ink on paper, still AA 4.5:1."
|
|
239
253
|
}
|
|
240
254
|
},
|
|
241
255
|
"border": {
|
|
@@ -246,6 +260,14 @@
|
|
|
246
260
|
"io.atom63.derive": "color-mix( in oklab, {a63.action.primary} 26%, color-mix(in oklab, {surface.light.5} 60%, white) )"
|
|
247
261
|
}
|
|
248
262
|
},
|
|
263
|
+
"input": {
|
|
264
|
+
"$type": "color",
|
|
265
|
+
"$value": "{a63.action.primary}",
|
|
266
|
+
"$extensions": {
|
|
267
|
+
"io.atom63.derive": "color-mix( in oklab, {a63.action.primary} 70%, {surface.light.10} )"
|
|
268
|
+
},
|
|
269
|
+
"$description": "Phosphor form-control border: 3:1 against the tinted page, panel and field fill."
|
|
270
|
+
},
|
|
249
271
|
"subtle": {
|
|
250
272
|
"$type": "color",
|
|
251
273
|
"$value": "{a63.action.primary}",
|
|
@@ -378,6 +400,14 @@
|
|
|
378
400
|
"io.atom63.derive": "color-mix(in oklab, {a63.text.accent} 48%, {surface.dark.11})"
|
|
379
401
|
},
|
|
380
402
|
"$description": "Text mixes read the brand-as-text token; the primary fill is too dark here."
|
|
403
|
+
},
|
|
404
|
+
"tertiary": {
|
|
405
|
+
"$type": "color",
|
|
406
|
+
"$value": "{a63.text.accent}",
|
|
407
|
+
"$extensions": {
|
|
408
|
+
"io.atom63.derive": "color-mix(in oklab, {a63.text.accent} 40%, {surface.dark.10})"
|
|
409
|
+
},
|
|
410
|
+
"$description": "Placeholders and meta: a dimmer phosphor than secondary, still AA 4.5:1."
|
|
381
411
|
}
|
|
382
412
|
},
|
|
383
413
|
"border": {
|
|
@@ -388,6 +418,13 @@
|
|
|
388
418
|
"io.atom63.derive": "color-mix(in oklch, {a63.action.primary} 42%, transparent)"
|
|
389
419
|
}
|
|
390
420
|
},
|
|
421
|
+
"input": {
|
|
422
|
+
"$type": "color",
|
|
423
|
+
"$value": "{a63.text.accent}",
|
|
424
|
+
"$extensions": {
|
|
425
|
+
"io.atom63.derive": "color-mix(in oklch, {a63.text.accent} 60%, transparent)"
|
|
426
|
+
}
|
|
427
|
+
},
|
|
391
428
|
"subtle": {
|
|
392
429
|
"$type": "color",
|
|
393
430
|
"$value": "{a63.action.primary}",
|
|
@@ -32,6 +32,10 @@
|
|
|
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
|
+
/* The brand as a gradient for heroes and banners: ramp 500 to 700 at 135deg. Declared with the ramp so a nested brand gets its own. */
|
|
36
|
+
--a63-gradient-brand: linear-gradient(135deg, var(--a63-brand-500), var(--a63-brand-700));
|
|
37
|
+
/* A quiet brand gradient for illustration backgrounds and cards: ramp 50 to 100 at 135deg. */
|
|
38
|
+
--a63-gradient-brand-subtle: linear-gradient(135deg, var(--a63-brand-50), var(--a63-brand-100));
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
[data-a63-brand='b3'] {
|
|
@@ -38,6 +38,24 @@
|
|
|
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
|
+
"gradient": {
|
|
43
|
+
"brand": {
|
|
44
|
+
"$type": "color",
|
|
45
|
+
"$value": "{a63.brand.500}",
|
|
46
|
+
"$description": "The brand as a gradient for heroes and banners: ramp 500 to 700 at 135deg. Declared with the ramp so a nested brand gets its own.",
|
|
47
|
+
"$extensions": {
|
|
48
|
+
"io.atom63.derive": "linear-gradient(135deg, {a63.brand.500}, {a63.brand.700})"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"brand-subtle": {
|
|
52
|
+
"$type": "color",
|
|
53
|
+
"$value": "{a63.brand.50}",
|
|
54
|
+
"$description": "A quiet brand gradient for illustration backgrounds and cards: ramp 50 to 100 at 135deg.",
|
|
55
|
+
"$extensions": {
|
|
56
|
+
"io.atom63.derive": "linear-gradient(135deg, {a63.brand.50}, {a63.brand.100})"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
41
59
|
}
|
|
42
60
|
}
|
|
43
61
|
}
|
|
@@ -12,6 +12,12 @@ const modes = ['light', 'dark'] as const
|
|
|
12
12
|
const textPairs = [
|
|
13
13
|
{ fg: '--a63-text-primary', bg: '--a63-surface-page', min: AA_TEXT },
|
|
14
14
|
{ fg: '--a63-text-secondary', bg: '--a63-surface-page', min: AA_TEXT },
|
|
15
|
+
// The third grey paints placeholders, meta and timestamps: on the page and the
|
|
16
|
+
// panel, in a field (the control fill) and in a filled field (the muted fill).
|
|
17
|
+
{ fg: '--a63-text-tertiary', bg: '--a63-surface-page', min: AA_TEXT },
|
|
18
|
+
{ fg: '--a63-text-tertiary', bg: '--a63-surface-panel', min: AA_TEXT },
|
|
19
|
+
{ fg: '--a63-text-tertiary', bg: '--a63-surface-control', min: AA_TEXT },
|
|
20
|
+
{ fg: '--a63-text-tertiary', bg: '--a63-surface-muted', min: AA_TEXT },
|
|
15
21
|
{ fg: '--a63-text-primary', bg: '--a63-surface-panel', min: AA_TEXT },
|
|
16
22
|
{ fg: '--a63-text-accent', bg: '--a63-surface-page', min: AA_TEXT },
|
|
17
23
|
{ fg: '--a63-text-accent', bg: '--a63-surface-panel', min: AA_TEXT },
|
|
@@ -22,6 +28,8 @@ const actionPairs = [
|
|
|
22
28
|
{ fg: '--a63-action-primary-foreground', bg: '--a63-action-primary', min: AA_TEXT },
|
|
23
29
|
{ fg: '--a63-action-neutral-foreground', bg: '--a63-action-neutral', min: AA_UI },
|
|
24
30
|
{ fg: '--a63-action-danger-foreground', bg: '--a63-action-danger', min: AA_UI },
|
|
31
|
+
// WCAG exempts disabled controls from 4.5:1, but the muted label stays legible.
|
|
32
|
+
{ fg: '--a63-action-disabled-foreground', bg: '--a63-action-disabled-background', min: 2.5 },
|
|
25
33
|
] as const
|
|
26
34
|
|
|
27
35
|
// Status accents paint icons and borders (alerts, copy check, load more), so
|
|
@@ -153,12 +161,21 @@ describe('core semantic contrast (WCAG AA)', () => {
|
|
|
153
161
|
const brands = ['b1', 'b2', 'b3', 'b4', 'b5', 'b6'] as const
|
|
154
162
|
const brandPairs = [
|
|
155
163
|
{ fg: '--a63-action-primary-foreground', bg: '--a63-action-primary', min: AA_TEXT },
|
|
164
|
+
// On-media labels in the dark zone of --a63-gradient-brand-fade: its lightest
|
|
165
|
+
// color there is brand 700, the stop at the end of the zone.
|
|
166
|
+
{ fg: '--a63-on-media-foreground', bg: '--a63-brand-800', min: AA_TEXT },
|
|
167
|
+
{ fg: '--a63-on-media-foreground', bg: '--a63-brand-700', min: AA_TEXT },
|
|
156
168
|
{ fg: '--a63-text-accent', bg: '--a63-surface-page', min: AA_TEXT },
|
|
157
169
|
// WCAG 1.4.11: a focus ring is the graphic that shows focus, so it reaches 3:1
|
|
158
170
|
// against the field it surrounds and the page around it.
|
|
159
171
|
{ fg: '--a63-focus-ring', bg: '--a63-surface-page', min: AA_UI },
|
|
160
172
|
{ fg: '--a63-focus-ring', bg: '--a63-surface-panel', min: AA_UI },
|
|
161
173
|
{ fg: '--a63-focus-ring', bg: '--a63-surface-control', min: AA_UI },
|
|
174
|
+
// WCAG 1.4.11: a form control's border is how a person finds the control, so it
|
|
175
|
+
// reaches 3:1 against the page, the panel and the field fill.
|
|
176
|
+
{ fg: '--a63-border-input', bg: '--a63-surface-page', min: AA_UI },
|
|
177
|
+
{ fg: '--a63-border-input', bg: '--a63-surface-panel', min: AA_UI },
|
|
178
|
+
{ fg: '--a63-border-input', bg: '--a63-surface-control', min: AA_UI },
|
|
162
179
|
] as const
|
|
163
180
|
|
|
164
181
|
describe('brand contrast (WCAG AA)', () => {
|
|
@@ -189,27 +206,34 @@ describe('brand contrast (WCAG AA)', () => {
|
|
|
189
206
|
|
|
190
207
|
it('keeps a selected item readable on every brand ramp', () => {
|
|
191
208
|
const failures: string[] = []
|
|
209
|
+
// The neutral selection (the default) and the opt-in accent selection.
|
|
210
|
+
const pairs = [
|
|
211
|
+
['selected', '--a63-selected-background', '--a63-selected-foreground'],
|
|
212
|
+
['selected-accent', '--a63-selected-accent-background', '--a63-selected-accent-foreground'],
|
|
213
|
+
] as const
|
|
192
214
|
for (const brand of brands) {
|
|
193
215
|
root().setAttribute('data-a63-brand', brand)
|
|
194
216
|
for (const theme of themes) {
|
|
195
217
|
for (const mode of modes) {
|
|
196
218
|
applyThemeMode(theme, mode)
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
219
|
+
for (const [label, bgVar, fgVar] of pairs) {
|
|
220
|
+
// A selection wash may be translucent: paint it over the page first.
|
|
221
|
+
const page = parseCssColor(resolvePaintedColor('--a63-surface-page', 'background'))
|
|
222
|
+
const washCss = resolvePaintedColor(bgVar, 'background')
|
|
223
|
+
const wash = parseCssColor(washCss)
|
|
224
|
+
const fill: Rgb = {
|
|
225
|
+
r: wash.r * wash.a + page.r * (1 - wash.a),
|
|
226
|
+
g: wash.g * wash.a + page.g * (1 - wash.a),
|
|
227
|
+
b: wash.b * wash.a + page.b * (1 - wash.a),
|
|
228
|
+
a: 1,
|
|
229
|
+
}
|
|
230
|
+
const fgCss = resolvePaintedColor(fgVar, 'color')
|
|
231
|
+
const ratio = contrastRatio(parseCssColor(fgCss), fill)
|
|
232
|
+
if (ratio < AA_TEXT) {
|
|
233
|
+
failures.push(
|
|
234
|
+
`${brand} ${theme}/${mode} ${label}: ${ratio.toFixed(2)}:1 < ${AA_TEXT}:1 (fg=${fgCss}, bg=${washCss})`
|
|
235
|
+
)
|
|
236
|
+
}
|
|
213
237
|
}
|
|
214
238
|
}
|
|
215
239
|
}
|