@atom63/styles 0.1.0-beta.1 → 0.1.0-beta.10
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/LICENSE +21 -0
- package/README.md +22 -13
- package/generated/atom63.figma-sync.json +23201 -0
- package/generated/atom63.tokens.json +19625 -8406
- package/generated/z-layers.d.ts +33 -0
- package/generated/z-layers.js +31 -0
- package/package.json +29 -15
- package/src/compat/a63-from-shadcn.css +275 -0
- package/src/compat/shadcn.browser.test.ts +23 -0
- package/src/compat/shadcn.css +133 -17
- package/src/contracts/action.css +4 -3
- package/src/contracts/action.native.css +11 -0
- package/src/contracts/action.tokens.json +66 -0
- package/src/contracts/badge.css +128 -58
- package/src/contracts/badge.resolver.json +454 -0
- package/src/contracts/choice.css +5 -2
- package/src/contracts/choice.native.css +9 -0
- package/src/contracts/choice.tokens.json +66 -0
- package/src/contracts/control.css +54 -57
- package/src/contracts/control.native.css +13 -0
- package/src/contracts/control.tokens.json +294 -0
- package/src/contracts/environment.css +178 -60
- package/src/contracts/environment.native.css +23 -0
- package/src/contracts/environment.resolver.json +1210 -0
- package/src/contracts/field.css +4 -2
- package/src/contracts/field.tokens.json +40 -0
- package/src/contracts/marker.css +6 -4
- package/src/contracts/marker.tokens.json +15 -0
- package/src/contracts/menu.css +25 -61
- package/src/contracts/menu.native.css +10 -0
- package/src/contracts/menu.resolver.json +122 -0
- package/src/contracts/overlay.css +11 -13
- package/src/contracts/overlay.native.css +13 -0
- package/src/contracts/overlay.tokens.json +103 -0
- package/src/contracts/segment.css +22 -68
- package/src/contracts/segment.tokens.json +19 -0
- package/src/contracts/selection.css +5 -1
- package/src/contracts/selection.tokens.json +42 -0
- package/src/contracts/skeleton.css +18 -2
- package/src/contracts/skeleton.resolver.json +62 -0
- package/src/contracts/surface.css +17 -24
- package/src/contracts/surface.native.css +17 -0
- package/src/contracts/surface.tokens.json +154 -0
- package/src/contracts/toggle.css +27 -3
- package/src/contracts/toggle.resolver.json +129 -0
- package/src/contracts/track.css +3 -1
- package/src/contracts/track.tokens.json +39 -0
- package/src/contracts/trigger.css +5 -2
- package/src/contracts/trigger.native.css +9 -0
- package/src/contracts/trigger.tokens.json +58 -0
- package/src/contracts/widget.css +76 -51
- package/src/contracts/widget.native.css +23 -0
- package/src/contracts/widget.resolver.json +1110 -0
- package/src/tailwind/roles.json +189 -0
- package/src/tailwind/theme.css +216 -24
- package/src/tailwind/utilities.css +17 -0
- package/src/themes/aqua.css +126 -89
- package/src/themes/aqua.native.css +80 -0
- package/src/themes/aqua.resolver.json +1304 -0
- package/src/themes/modern.css +10 -14
- package/src/themes/modern.native.css +16 -0
- package/src/themes/modern.resolver.json +350 -0
- package/src/themes/retro.css +22 -26
- package/src/themes/retro.native.css +16 -0
- package/src/themes/retro.resolver.json +794 -0
- package/src/themes/terminal.css +151 -41
- package/src/themes/terminal.native.css +22 -0
- package/src/themes/terminal.resolver.json +585 -0
- package/src/tokens/brand-action.css +65 -0
- package/src/tokens/brand-action.resolver.json +155 -0
- package/src/tokens/brand-ramp.css +108 -0
- package/src/tokens/brand-ramp.resolver.json +418 -0
- package/src/tokens/brand.css +6 -146
- package/src/tokens/color-mix-space.browser.test.ts +101 -0
- package/src/tokens/contrast.browser.test.ts +257 -5
- package/src/tokens/density.browser.test.ts +167 -0
- package/src/tokens/figma-parity.browser.test.ts +270 -0
- package/src/tokens/font.css +12 -0
- package/src/tokens/font.resolver.json +128 -0
- package/src/tokens/form-factor.browser.test.ts +129 -0
- package/src/tokens/foundation/effects.css +13 -13
- package/src/tokens/foundation/effects.resolver.json +433 -0
- package/src/tokens/foundation/fonts.css +11 -5
- package/src/tokens/foundation/fonts.tokens.json +45 -0
- package/src/tokens/foundation/motion.css +3 -0
- package/src/tokens/foundation/motion.tokens.json +53 -0
- package/src/tokens/foundation/palette.css +3 -0
- package/src/tokens/foundation/palette.tokens.json +1743 -0
- package/src/tokens/foundation/primitives.css +20 -43
- package/src/tokens/foundation/primitives.tokens.json +3258 -0
- package/src/tokens/foundation/radius.css +11 -9
- package/src/tokens/foundation/radius.tokens.json +108 -0
- package/src/tokens/foundation/typography.css +49 -12
- package/src/tokens/foundation/typography.native.css +21 -0
- package/src/tokens/foundation/typography.resolver.json +1008 -0
- package/src/tokens/foundation.css +0 -1
- package/src/tokens/index.css +1 -0
- package/src/tokens/motion.css +3 -1
- package/src/tokens/motion.resolver.json +135 -0
- package/src/tokens/native-values.json +38 -0
- package/src/tokens/personalization-axes.browser.test.ts +18 -3
- package/src/tokens/plate-scope.browser.test.ts +73 -0
- package/src/tokens/radius.css +12 -8
- package/src/tokens/radius.resolver.json +138 -0
- package/src/tokens/semantics.css +656 -39
- package/src/tokens/semantics.resolver.json +1606 -0
- package/src/tokens/space.css +8 -6
- package/src/tokens/space.tokens.json +78 -0
- package/src/tokens/surface.css +13 -19
- package/src/tokens/surface.resolver.json +706 -0
- package/src/tokens/swift-parity.browser.test.ts +141 -0
- package/src/tokens/type-roles.css +88 -0
- package/src/tokens/type-roles.resolver.json +419 -0
- package/src/tokens/type-scale.css +6 -0
- package/src/tokens/type-scale.resolver.json +67 -0
- package/generated/atom63.figma-tokens.json +0 -21664
- package/src/tokens/foundation/aliases.css +0 -28
- package/src/z-layers.ts +0 -40
package/src/tokens/index.css
CHANGED
package/src/tokens/motion.css
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
+
* Generated from src/tokens/motion.resolver.json by scripts/build-css-from-dtcg.mjs. Do not edit;
|
|
3
|
+
* change the DTCG source and run `pnpm --filter @atom63/styles generate:tokens`.
|
|
4
|
+
*
|
|
2
5
|
* Motion contract.
|
|
3
6
|
*
|
|
4
7
|
* The interaction-timing intents the system uses. Raw --duration-* / --ease-*
|
|
5
8
|
* primitives remain available for anything else.
|
|
6
9
|
*/
|
|
7
|
-
|
|
8
10
|
:root {
|
|
9
11
|
--a63-motion-duration-fast: var(--duration-fast);
|
|
10
12
|
--a63-motion-duration-overlay: var(--duration-overlay);
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2025.10",
|
|
3
|
+
"description": "Motion contract.\n\nThe interaction-timing intents the system uses. Raw --duration-* / --ease-*\nprimitives remain available for anything else.",
|
|
4
|
+
"sets": {
|
|
5
|
+
"01-root": {
|
|
6
|
+
"sources": [
|
|
7
|
+
{
|
|
8
|
+
"a63": {
|
|
9
|
+
"motion": {
|
|
10
|
+
"duration": {
|
|
11
|
+
"fast": {
|
|
12
|
+
"$type": "duration",
|
|
13
|
+
"$value": "{duration.fast}"
|
|
14
|
+
},
|
|
15
|
+
"overlay": {
|
|
16
|
+
"$type": "duration",
|
|
17
|
+
"$value": "{duration.overlay}"
|
|
18
|
+
},
|
|
19
|
+
"swipe": {
|
|
20
|
+
"dismiss": {
|
|
21
|
+
"$type": "duration",
|
|
22
|
+
"$value": "{duration.swipe.dismiss}"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"ease": {
|
|
27
|
+
"overlay": {
|
|
28
|
+
"$type": "cubicBezier",
|
|
29
|
+
"$value": "{ease.overlay}"
|
|
30
|
+
},
|
|
31
|
+
"scrim": {
|
|
32
|
+
"$type": "cubicBezier",
|
|
33
|
+
"$value": "{ease.scrim}"
|
|
34
|
+
},
|
|
35
|
+
"standard": {
|
|
36
|
+
"$type": "cubicBezier",
|
|
37
|
+
"$value": "{ease.standard}"
|
|
38
|
+
},
|
|
39
|
+
"emphasized": {
|
|
40
|
+
"$type": "cubicBezier",
|
|
41
|
+
"$value": "{ease.emphasized}"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"control": {
|
|
45
|
+
"feedback": {
|
|
46
|
+
"duration": {
|
|
47
|
+
"$type": "duration",
|
|
48
|
+
"$value": "{a63.motion.duration.fast}"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"skeleton": {
|
|
53
|
+
"shimmer": {
|
|
54
|
+
"duration": {
|
|
55
|
+
"$type": "duration",
|
|
56
|
+
"$value": "{duration.1500}"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"$extensions": {
|
|
65
|
+
"io.atom63.css": {
|
|
66
|
+
"selector": ":root"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"02-media-prefers-reduced-motion-reduce-root": {
|
|
71
|
+
"sources": [
|
|
72
|
+
{
|
|
73
|
+
"a63": {
|
|
74
|
+
"motion": {
|
|
75
|
+
"control": {
|
|
76
|
+
"feedback": {
|
|
77
|
+
"duration": {
|
|
78
|
+
"$type": "duration",
|
|
79
|
+
"$value": {
|
|
80
|
+
"value": 0,
|
|
81
|
+
"unit": "ms"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"duration": {
|
|
87
|
+
"overlay": {
|
|
88
|
+
"$type": "duration",
|
|
89
|
+
"$value": {
|
|
90
|
+
"value": 0,
|
|
91
|
+
"unit": "ms"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"swipe": {
|
|
95
|
+
"dismiss": {
|
|
96
|
+
"$type": "duration",
|
|
97
|
+
"$value": {
|
|
98
|
+
"value": 0,
|
|
99
|
+
"unit": "ms"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"skeleton": {
|
|
105
|
+
"shimmer": {
|
|
106
|
+
"duration": {
|
|
107
|
+
"$type": "duration",
|
|
108
|
+
"$value": {
|
|
109
|
+
"value": 0,
|
|
110
|
+
"unit": "ms"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"$extensions": {
|
|
120
|
+
"io.atom63.css": {
|
|
121
|
+
"selector": ":root",
|
|
122
|
+
"atRule": "@media (prefers-reduced-motion: reduce)"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"resolutionOrder": [
|
|
128
|
+
{
|
|
129
|
+
"$ref": "#/sets/01-root"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"$ref": "#/sets/02-media-prefers-reduced-motion-reduce-root"
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "CSS-native token values: values with no DTCG type, declared by hand in *.native.css files. Each entry says why it cannot be a DTCG token. build-css-from-dtcg.mjs --check fails on an unlisted declaration or a stale entry. See docs/design-system/token-single-source.md.",
|
|
3
|
+
"values": {
|
|
4
|
+
"--a63-action-control-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
5
|
+
"--a63-action-control-highlight": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
6
|
+
"--a63-action-control-press-transform": "A CSS transform (translateY / scale); DTCG has no transform type.",
|
|
7
|
+
"--a63-choice-indicator-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
8
|
+
"--a63-control-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
9
|
+
"--a63-control-highlight": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
10
|
+
"--a63-control-press-transform": "A CSS transform (translateY / scale); DTCG has no transform type.",
|
|
11
|
+
"--a63-menu-highlight-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
12
|
+
"--a63-menu-popup-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
13
|
+
"--a63-overlay-backdrop": "A backdrop-filter value (default none, blur in translucent themes); DTCG has no filter type.",
|
|
14
|
+
"--a63-overlay-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
15
|
+
"--a63-overlay-highlight": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
16
|
+
"--a63-overlay-texture-blend": "A mix-blend-mode keyword; DTCG has no blend-mode type.",
|
|
17
|
+
"--a63-overlay-texture-image": "A background-image texture (default none); DTCG has no image type.",
|
|
18
|
+
"--a63-safe-area-bottom": "env(safe-area-inset-*, 0px): a device value only the browser knows; DTCG has no environment-variable value.",
|
|
19
|
+
"--a63-safe-area-left": "env(safe-area-inset-*, 0px): a device value only the browser knows; DTCG has no environment-variable value.",
|
|
20
|
+
"--a63-safe-area-right": "env(safe-area-inset-*, 0px): a device value only the browser knows; DTCG has no environment-variable value.",
|
|
21
|
+
"--a63-safe-area-top": "env(safe-area-inset-*, 0px): a device value only the browser knows; DTCG has no environment-variable value.",
|
|
22
|
+
"--a63-segment-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
23
|
+
"--a63-segment-selected-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
24
|
+
"--a63-segment-track-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
25
|
+
"--a63-surface-backdrop": "A backdrop-filter value (default none, blur in translucent themes); DTCG has no filter type.",
|
|
26
|
+
"--a63-surface-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
27
|
+
"--a63-surface-highlight": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
|
|
28
|
+
"--a63-surface-texture-blend": "A mix-blend-mode keyword; DTCG has no blend-mode type.",
|
|
29
|
+
"--a63-surface-texture-image": "A background-image texture (default none); DTCG has no image type.",
|
|
30
|
+
"--a63-trigger-indicator-size": "Sized in em, relative to the trigger's font size; DTCG dimensions are px or rem only.",
|
|
31
|
+
"--a63-viewport-height": "100vh / 100dvh: viewport units, with dvh behind @supports; DTCG dimensions are px or rem only.",
|
|
32
|
+
"--a63-weather-backdrop": "A backdrop-filter value; DTCG has no filter type.",
|
|
33
|
+
"--a63-weather-background-blend": "A blend-mode keyword; DTCG has no blend-mode type.",
|
|
34
|
+
"--a63-widget-backdrop": "A backdrop-filter value; DTCG has no filter type.",
|
|
35
|
+
"--a63-widget-rim-backdrop": "A backdrop-filter value; DTCG has no filter type.",
|
|
36
|
+
"--a63-widget-rim-image": "A background-image layer; DTCG has no image or gradient type."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -53,6 +53,19 @@ describe('radius scale axis', () => {
|
|
|
53
53
|
probe.remove()
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
+
it('keeps --radius-pill a fixed 9999px pill on every radius axis value', () => {
|
|
57
|
+
const probe = document.createElement('div')
|
|
58
|
+
probe.style.borderRadius = 'var(--radius-pill)'
|
|
59
|
+
document.body.appendChild(probe)
|
|
60
|
+
|
|
61
|
+
expect(getComputedStyle(probe).borderRadius).toBe('9999px')
|
|
62
|
+
for (const value of ['none', 'subtle', 'default', 'round']) {
|
|
63
|
+
root().setAttribute('data-a63-radius', value)
|
|
64
|
+
expect(getComputedStyle(probe).borderRadius).toBe('9999px')
|
|
65
|
+
}
|
|
66
|
+
probe.remove()
|
|
67
|
+
})
|
|
68
|
+
|
|
56
69
|
it('keeps avatar radius circular by default while still following the radius axis', () => {
|
|
57
70
|
const probe = document.createElement('div')
|
|
58
71
|
probe.style.borderRadius = 'var(--a63-avatar-radius)'
|
|
@@ -155,12 +168,14 @@ describe('os axis', () => {
|
|
|
155
168
|
})
|
|
156
169
|
|
|
157
170
|
describe('auto brand ramp', () => {
|
|
171
|
+
// The primary action uses step 600 of the ramp, which keeps white text at
|
|
172
|
+
// WCAG AA contrast (see tokens/brand.css).
|
|
158
173
|
it('falls back to the b1 ramp when no --color-auto-* is set', () => {
|
|
159
174
|
const el = root()
|
|
160
175
|
el.setAttribute('data-a63-brand', 'auto')
|
|
161
|
-
// --a63-action-primary = --a63-brand-
|
|
176
|
+
// --a63-action-primary = --a63-brand-600 = var(--color-auto-600, var(--color-b1-600))
|
|
162
177
|
const primary = cssVar('--a63-action-primary')
|
|
163
|
-
const b1 = getComputedStyle(el).getPropertyValue('--color-b1-
|
|
178
|
+
const b1 = getComputedStyle(el).getPropertyValue('--color-b1-600').trim()
|
|
164
179
|
expect(primary).toBe(b1)
|
|
165
180
|
expect(primary).not.toBe('')
|
|
166
181
|
})
|
|
@@ -168,7 +183,7 @@ describe('auto brand ramp', () => {
|
|
|
168
183
|
it('uses the extracted --color-auto ramp when present', () => {
|
|
169
184
|
const el = root()
|
|
170
185
|
el.setAttribute('data-a63-brand', 'auto')
|
|
171
|
-
el.style.setProperty('--color-auto-
|
|
186
|
+
el.style.setProperty('--color-auto-600', 'rgb(10, 20, 30)')
|
|
172
187
|
expect(cssVar('--a63-action-primary')).toBe('rgb(10, 20, 30)')
|
|
173
188
|
})
|
|
174
189
|
})
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// A plate scope (scripts/design-system/plate-palette.mjs) on the real cascade:
|
|
2
|
+
// the page tone, ink and brand ramp it writes must reach the semantic roles on
|
|
3
|
+
// the scope, swap in a nested dark band, and leave the page outside alone.
|
|
4
|
+
import { afterEach, describe, expect, it } from 'vitest'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
platePalette,
|
|
8
|
+
plateScopeCss,
|
|
9
|
+
quantize,
|
|
10
|
+
} from '../../../../scripts/design-system/lib/plate-palette.mjs'
|
|
11
|
+
import '../test/apply-styles'
|
|
12
|
+
|
|
13
|
+
const repeat = (rgb: number[], count: number) => Array.from({ length: count }, () => rgb)
|
|
14
|
+
const SKY = [232, 236, 240]
|
|
15
|
+
const pixels = [...repeat(SKY, 600), ...repeat([20, 26, 34], 340), ...repeat([214, 40, 38], 30)]
|
|
16
|
+
const palette = platePalette({ plate: quantize(pixels, 3), safeArea: quantize(repeat(SKY, 20), 1) })
|
|
17
|
+
|
|
18
|
+
const rgb = ([r, g, b]: number[]) => `rgb(${r}, ${g}, ${b})`
|
|
19
|
+
|
|
20
|
+
function mount() {
|
|
21
|
+
const style = document.createElement('style')
|
|
22
|
+
style.textContent = plateScopeCss('test-plate', palette, 'fixture')
|
|
23
|
+
document.head.append(style)
|
|
24
|
+
const outside = document.createElement('div')
|
|
25
|
+
const scope = document.createElement('div')
|
|
26
|
+
scope.dataset.a63Plate = 'test-plate'
|
|
27
|
+
scope.dataset.a63Brand = 'auto'
|
|
28
|
+
const band = document.createElement('div')
|
|
29
|
+
band.dataset.a63Mode = 'dark'
|
|
30
|
+
scope.append(band)
|
|
31
|
+
document.body.append(outside, scope)
|
|
32
|
+
const paint = (element: HTMLElement, role: string) => {
|
|
33
|
+
element.style.backgroundColor = `var(${role})`
|
|
34
|
+
return getComputedStyle(element).backgroundColor
|
|
35
|
+
}
|
|
36
|
+
const ink = (element: HTMLElement) => {
|
|
37
|
+
element.style.color = 'var(--a63-text-primary)'
|
|
38
|
+
return getComputedStyle(element).color
|
|
39
|
+
}
|
|
40
|
+
return { style, outside, scope, band, paint, ink }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
afterEach(() => {
|
|
44
|
+
document.body.replaceChildren()
|
|
45
|
+
for (const style of document.head.querySelectorAll('style:not([data-vite-dev-id])')) {
|
|
46
|
+
if (style.textContent?.includes('test-plate')) style.remove()
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
describe('plate scope', () => {
|
|
51
|
+
it('sets the page tone and the ink on the scope', () => {
|
|
52
|
+
const { scope, paint, ink } = mount()
|
|
53
|
+
expect(paint(scope, '--a63-surface-page')).toBe(rgb(palette.surfaces.light))
|
|
54
|
+
expect(ink(scope)).toBe(rgb(palette.surfaces.dark))
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('swaps them in a nested dark band', () => {
|
|
58
|
+
const { band, paint, ink } = mount()
|
|
59
|
+
expect(paint(band, '--a63-surface-page')).toBe(rgb(palette.surfaces.dark))
|
|
60
|
+
expect(ink(band)).toBe(rgb(palette.surfaces.light))
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('derives the primary action from the accent ramp', () => {
|
|
64
|
+
const { scope, paint } = mount()
|
|
65
|
+
const step600 = palette.ramp!.find(entry => entry.step === 600)!.rgb
|
|
66
|
+
expect(paint(scope, '--a63-action-primary')).toBe(rgb(step600))
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it('leaves the page outside the scope on the theme', () => {
|
|
70
|
+
const { outside, scope, paint } = mount()
|
|
71
|
+
expect(paint(outside, '--a63-surface-page')).not.toBe(paint(scope, '--a63-surface-page'))
|
|
72
|
+
})
|
|
73
|
+
})
|
package/src/tokens/radius.css
CHANGED
|
@@ -1,34 +1,38 @@
|
|
|
1
1
|
/*
|
|
2
|
+
* Generated from src/tokens/radius.resolver.json by scripts/build-css-from-dtcg.mjs. Do not edit;
|
|
3
|
+
* change the DTCG source and run `pnpm --filter @atom63/styles generate:tokens`.
|
|
4
|
+
*
|
|
2
5
|
* Radius contract.
|
|
3
6
|
*
|
|
4
7
|
* A stable intent name over the radius anchor/multiplier model for executable UI
|
|
5
8
|
* recipes. Raw --radius-* primitives remain available for other needs.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
:root {
|
|
9
|
-
--a63-avatar-radius: 50%;
|
|
10
|
-
--a63-radius-control: var(--radius-lg);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/*
|
|
9
|
+
*
|
|
14
10
|
* Radius personalization axis.
|
|
15
11
|
*
|
|
16
12
|
* [data-a63-radius] sets the multiplier the whole --radius-* scale (foundation/
|
|
17
13
|
* radius.css) already multiplies by, so one attribute rescales every corner.
|
|
18
14
|
* `default` = 1 restates the foundation default so a subtree can override back.
|
|
19
15
|
*/
|
|
16
|
+
:root {
|
|
17
|
+
--a63-avatar-radius: 50%;
|
|
18
|
+
--a63-radius-control: var(--radius-lg);
|
|
19
|
+
}
|
|
20
|
+
|
|
20
21
|
[data-a63-radius='none'] {
|
|
21
22
|
--a63-avatar-radius: 0;
|
|
22
23
|
--radius-multiplier: 0;
|
|
23
24
|
}
|
|
25
|
+
|
|
24
26
|
[data-a63-radius='subtle'] {
|
|
25
27
|
--a63-avatar-radius: var(--radius-full);
|
|
26
28
|
--radius-multiplier: 0.5;
|
|
27
29
|
}
|
|
30
|
+
|
|
28
31
|
[data-a63-radius='default'] {
|
|
29
32
|
--a63-avatar-radius: 50%;
|
|
30
33
|
--radius-multiplier: 1;
|
|
31
34
|
}
|
|
35
|
+
|
|
32
36
|
[data-a63-radius='round'] {
|
|
33
37
|
--a63-avatar-radius: 50%;
|
|
34
38
|
--radius-multiplier: 1.5;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2025.10",
|
|
3
|
+
"description": "Radius contract.\n\nA stable intent name over the radius anchor/multiplier model for executable UI\nrecipes. Raw --radius-* primitives remain available for other needs.\n\nRadius personalization axis.\n\n[data-a63-radius] sets the multiplier the whole --radius-* scale (foundation/\nradius.css) already multiplies by, so one attribute rescales every corner.\n`default` = 1 restates the foundation default so a subtree can override back.",
|
|
4
|
+
"sets": {
|
|
5
|
+
"base": {
|
|
6
|
+
"sources": [
|
|
7
|
+
{
|
|
8
|
+
"a63": {
|
|
9
|
+
"avatar": {
|
|
10
|
+
"radius": {
|
|
11
|
+
"$type": "number",
|
|
12
|
+
"$value": 50,
|
|
13
|
+
"$extensions": {
|
|
14
|
+
"io.atom63.derive": "50%"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"radius": {
|
|
19
|
+
"control": {
|
|
20
|
+
"$type": "dimension",
|
|
21
|
+
"$value": "{radius.lg}"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"$extensions": {
|
|
28
|
+
"io.atom63.css": {
|
|
29
|
+
"selector": ":root"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"modifiers": {
|
|
35
|
+
"radius": {
|
|
36
|
+
"default": "default",
|
|
37
|
+
"contexts": {
|
|
38
|
+
"none": [
|
|
39
|
+
{
|
|
40
|
+
"a63": {
|
|
41
|
+
"avatar": {
|
|
42
|
+
"radius": {
|
|
43
|
+
"$type": "number",
|
|
44
|
+
"$value": 0
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"radius": {
|
|
49
|
+
"multiplier": {
|
|
50
|
+
"$type": "number",
|
|
51
|
+
"$value": 0
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"subtle": [
|
|
57
|
+
{
|
|
58
|
+
"a63": {
|
|
59
|
+
"avatar": {
|
|
60
|
+
"radius": {
|
|
61
|
+
"$type": "dimension",
|
|
62
|
+
"$value": "{radius.full}"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"radius": {
|
|
67
|
+
"multiplier": {
|
|
68
|
+
"$type": "number",
|
|
69
|
+
"$value": 0.5
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"default": [
|
|
75
|
+
{
|
|
76
|
+
"a63": {
|
|
77
|
+
"avatar": {
|
|
78
|
+
"radius": {
|
|
79
|
+
"$type": "number",
|
|
80
|
+
"$value": 50,
|
|
81
|
+
"$extensions": {
|
|
82
|
+
"io.atom63.derive": "50%"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"radius": {
|
|
88
|
+
"multiplier": {
|
|
89
|
+
"$type": "number",
|
|
90
|
+
"$value": 1
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"round": [
|
|
96
|
+
{
|
|
97
|
+
"a63": {
|
|
98
|
+
"avatar": {
|
|
99
|
+
"radius": {
|
|
100
|
+
"$type": "number",
|
|
101
|
+
"$value": 50,
|
|
102
|
+
"$extensions": {
|
|
103
|
+
"io.atom63.derive": "50%"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"radius": {
|
|
109
|
+
"multiplier": {
|
|
110
|
+
"$type": "number",
|
|
111
|
+
"$value": 1.5
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"resolutionOrder": [
|
|
120
|
+
{
|
|
121
|
+
"$ref": "#/sets/base"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"$ref": "#/modifiers/radius"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"$extensions": {
|
|
128
|
+
"io.atom63.css": {
|
|
129
|
+
"attribute": "data-a63-radius",
|
|
130
|
+
"selectors": {
|
|
131
|
+
"none": "[data-a63-radius='none']",
|
|
132
|
+
"subtle": "[data-a63-radius='subtle']",
|
|
133
|
+
"default": "[data-a63-radius='default']",
|
|
134
|
+
"round": "[data-a63-radius='round']"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|