@atom63/styles 0.1.0-beta.0
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 +233 -0
- package/generated/atom63.figma-tokens.json +21650 -0
- package/generated/atom63.tokens.json +21909 -0
- package/package.json +116 -0
- package/src/animations/animations.css +55 -0
- package/src/animations/index.css +1 -0
- package/src/compat/a63-from-shadcn.css +141 -0
- package/src/compat/index.css +2 -0
- package/src/compat/mdx.css +13 -0
- package/src/compat/shadcn.css +52 -0
- package/src/contracts/action.css +31 -0
- package/src/contracts/badge.css +68 -0
- package/src/contracts/choice.css +32 -0
- package/src/contracts/control.css +102 -0
- package/src/contracts/environment.css +158 -0
- package/src/contracts/field.css +26 -0
- package/src/contracts/index.css +26 -0
- package/src/contracts/marker.css +23 -0
- package/src/contracts/menu.css +100 -0
- package/src/contracts/overlay.css +44 -0
- package/src/contracts/segment.css +100 -0
- package/src/contracts/selection.css +21 -0
- package/src/contracts/skeleton.css +14 -0
- package/src/contracts/surface.css +56 -0
- package/src/contracts/toggle.css +26 -0
- package/src/contracts/track.css +26 -0
- package/src/contracts/trigger.css +28 -0
- package/src/contracts/widget.css +196 -0
- package/src/index.css +17 -0
- package/src/manifest/types.ts +61 -0
- package/src/os/index.css +2 -0
- package/src/os/macos.css +54 -0
- package/src/os/windows.css +299 -0
- package/src/tailwind/animations.css +8 -0
- package/src/tailwind/index.css +4 -0
- package/src/tailwind/theme.css +516 -0
- package/src/tailwind/utilities.css +41 -0
- package/src/tailwind/variants.css +64 -0
- package/src/test/apply-styles.ts +30 -0
- package/src/themes/aqua.css +240 -0
- package/src/themes/index.css +4 -0
- package/src/themes/modern.css +55 -0
- package/src/themes/retro.css +112 -0
- package/src/themes/terminal.css +179 -0
- package/src/tokens/brand.css +148 -0
- package/src/tokens/contrast.browser.test.ts +140 -0
- package/src/tokens/font.css +24 -0
- package/src/tokens/foundation/aliases.css +28 -0
- package/src/tokens/foundation/effects.css +31 -0
- package/src/tokens/foundation/fonts.css +11 -0
- package/src/tokens/foundation/motion.css +19 -0
- package/src/tokens/foundation/palette.css +255 -0
- package/src/tokens/foundation/primitives.css +420 -0
- package/src/tokens/foundation/radius.css +36 -0
- package/src/tokens/foundation/typography.css +191 -0
- package/src/tokens/foundation.css +15 -0
- package/src/tokens/index.css +9 -0
- package/src/tokens/motion.css +27 -0
- package/src/tokens/personalization-axes.browser.test.ts +240 -0
- package/src/tokens/radius.css +35 -0
- package/src/tokens/semantics.css +157 -0
- package/src/tokens/space.css +21 -0
- package/src/tokens/surface.css +184 -0
- package/src/tokens/theme-overrides.browser.test.ts +140 -0
- package/src/tokens/type-scale.css +20 -0
- package/src/tokens/widget-chrome-signature.browser.test.ts +225 -0
- package/src/tokens/widget-paint.browser.test.ts +98 -0
- package/src/utils/code-highlighting.css +35 -0
- package/src/utils/debug.css +453 -0
- package/src/utils/index.css +9 -0
- package/src/utils/scroll-bar.css +78 -0
- package/src/utils/scroll-mask.css +119 -0
- package/src/utils/view-transition.css +16 -0
- package/src/z-layers.ts +40 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Motion contract.
|
|
3
|
+
*
|
|
4
|
+
* The interaction-timing intents the system uses. Raw --duration-* / --ease-*
|
|
5
|
+
* primitives remain available for anything else.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
:root {
|
|
9
|
+
--a63-motion-duration-fast: var(--duration-fast);
|
|
10
|
+
--a63-motion-duration-overlay: var(--duration-overlay);
|
|
11
|
+
--a63-motion-duration-swipe-dismiss: var(--duration-swipe-dismiss);
|
|
12
|
+
--a63-motion-ease-overlay: var(--ease-overlay);
|
|
13
|
+
--a63-motion-ease-scrim: var(--ease-scrim);
|
|
14
|
+
--a63-motion-ease-standard: var(--ease-standard);
|
|
15
|
+
--a63-motion-ease-emphasized: var(--ease-emphasized);
|
|
16
|
+
--a63-motion-control-feedback-duration: var(--a63-motion-duration-fast);
|
|
17
|
+
--a63-motion-skeleton-shimmer-duration: var(--duration-1500);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (prefers-reduced-motion: reduce) {
|
|
21
|
+
:root {
|
|
22
|
+
--a63-motion-control-feedback-duration: 0ms;
|
|
23
|
+
--a63-motion-duration-overlay: 0ms;
|
|
24
|
+
--a63-motion-duration-swipe-dismiss: 0ms;
|
|
25
|
+
--a63-motion-skeleton-shimmer-duration: 0ms;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it } from 'vitest'
|
|
2
|
+
import { cssVar, resetRoot, root } from '../test/apply-styles'
|
|
3
|
+
|
|
4
|
+
afterEach(resetRoot)
|
|
5
|
+
|
|
6
|
+
describe('@atom63/styles cascade harness', () => {
|
|
7
|
+
it('applies the foundation: --radius-multiplier defaults to 1', () => {
|
|
8
|
+
expect(cssVar('--radius-multiplier')).toBe('1')
|
|
9
|
+
})
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
describe('radius scale axis', () => {
|
|
13
|
+
it('maps each [data-a63-radius] value to --radius-multiplier', () => {
|
|
14
|
+
const el = root()
|
|
15
|
+
const cases: Array<[string, string]> = [
|
|
16
|
+
['none', '0'],
|
|
17
|
+
['subtle', '0.5'],
|
|
18
|
+
['default', '1'],
|
|
19
|
+
['round', '1.5'],
|
|
20
|
+
]
|
|
21
|
+
for (const [value, expected] of cases) {
|
|
22
|
+
el.setAttribute('data-a63-radius', value)
|
|
23
|
+
expect(cssVar('--radius-multiplier')).toBe(expected)
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it('re-resolves the derived --radius-lg when the multiplier changes', () => {
|
|
28
|
+
root().setAttribute('data-a63-radius', 'none')
|
|
29
|
+
// Custom properties are only substituted, not calc-evaluated, until consumed
|
|
30
|
+
// by a real property — so resolve --radius-lg through an element's border-radius.
|
|
31
|
+
const probe = document.createElement('div')
|
|
32
|
+
probe.style.borderRadius = 'var(--radius-lg)'
|
|
33
|
+
document.body.appendChild(probe)
|
|
34
|
+
// --radius-lg = corner-radius(10px) * multiplier(0) => 0px
|
|
35
|
+
expect(getComputedStyle(probe).borderRadius).toBe('0px')
|
|
36
|
+
probe.remove()
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('keeps --radius-full on the scale curve (2× xl), not a fixed 9999px pill', () => {
|
|
40
|
+
const probe = document.createElement('div')
|
|
41
|
+
probe.style.borderRadius = 'var(--radius-full)'
|
|
42
|
+
document.body.appendChild(probe)
|
|
43
|
+
|
|
44
|
+
// default: xl = 10 * 1.4 * 1 = 14px → full = 28px
|
|
45
|
+
expect(getComputedStyle(probe).borderRadius).toBe('28px')
|
|
46
|
+
|
|
47
|
+
root().setAttribute('data-a63-radius', 'none')
|
|
48
|
+
expect(getComputedStyle(probe).borderRadius).toBe('0px')
|
|
49
|
+
|
|
50
|
+
root().setAttribute('data-a63-radius', 'round')
|
|
51
|
+
// xl = 10 * 1.4 * 1.5 = 21px → full = 42px
|
|
52
|
+
expect(getComputedStyle(probe).borderRadius).toBe('42px')
|
|
53
|
+
probe.remove()
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('keeps avatar radius circular by default while still following the radius axis', () => {
|
|
57
|
+
const probe = document.createElement('div')
|
|
58
|
+
probe.style.borderRadius = 'var(--a63-avatar-radius)'
|
|
59
|
+
document.body.appendChild(probe)
|
|
60
|
+
|
|
61
|
+
expect(getComputedStyle(probe).borderRadius).toBe('50%')
|
|
62
|
+
|
|
63
|
+
root().setAttribute('data-a63-radius', 'none')
|
|
64
|
+
expect(getComputedStyle(probe).borderRadius).toBe('0px')
|
|
65
|
+
|
|
66
|
+
root().setAttribute('data-a63-radius', 'subtle')
|
|
67
|
+
expect(getComputedStyle(probe).borderRadius).toBe('14px')
|
|
68
|
+
|
|
69
|
+
root().setAttribute('data-a63-radius', 'round')
|
|
70
|
+
expect(getComputedStyle(probe).borderRadius).toBe('50%')
|
|
71
|
+
probe.remove()
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
describe('type scale axis', () => {
|
|
76
|
+
it('maps each [data-a63-type-scale] value to --typography-scale', () => {
|
|
77
|
+
const el = root()
|
|
78
|
+
const cases: Array<[string, string]> = [
|
|
79
|
+
['compact', '0.9'],
|
|
80
|
+
['normal', '1'],
|
|
81
|
+
['comfortable', '1.1'],
|
|
82
|
+
['large', '1.2'],
|
|
83
|
+
]
|
|
84
|
+
for (const [value, expected] of cases) {
|
|
85
|
+
el.setAttribute('data-a63-type-scale', value)
|
|
86
|
+
expect(cssVar('--typography-scale')).toBe(expected)
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it('re-resolves a derived type token when the scale changes', () => {
|
|
91
|
+
root().setAttribute('data-a63-type-scale', 'compact')
|
|
92
|
+
// Custom props aren't calc-evaluated until consumed by a real property, so
|
|
93
|
+
// resolve --typography-base-font-size through an element's font-size.
|
|
94
|
+
const probe = document.createElement('div')
|
|
95
|
+
probe.style.fontSize = 'var(--typography-base-font-size)'
|
|
96
|
+
document.body.appendChild(probe)
|
|
97
|
+
// base font-size 15px * 0.9 = 13.5px
|
|
98
|
+
expect(getComputedStyle(probe).fontSize).toBe('13.5px')
|
|
99
|
+
probe.remove()
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
describe('font family axis', () => {
|
|
104
|
+
it('defaults --a63-font-app to the sans stack', () => {
|
|
105
|
+
expect(cssVar('--a63-font-app')).toContain('Geist')
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
it('remaps --a63-font-app per [data-a63-font]', () => {
|
|
109
|
+
const el = root()
|
|
110
|
+
el.setAttribute('data-a63-font', 'serif')
|
|
111
|
+
expect(cssVar('--a63-font-app')).toContain('Brawler')
|
|
112
|
+
|
|
113
|
+
el.setAttribute('data-a63-font', 'mono')
|
|
114
|
+
expect(cssVar('--a63-font-app')).toContain('Geist Mono')
|
|
115
|
+
|
|
116
|
+
el.setAttribute('data-a63-font', 'pixel')
|
|
117
|
+
// Pixel resolves to Doto (Google Fonts) — the self-hosted Geist Pixel faces
|
|
118
|
+
// were retired when the apps moved their pixel axis to Doto.
|
|
119
|
+
expect(cssVar('--a63-font-app')).toContain('Doto')
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
describe('os axis', () => {
|
|
124
|
+
it('defaults to macOS window-action geometry on :root', () => {
|
|
125
|
+
expect(cssVar('--a63-os-window-action-width')).toBe('1.5rem')
|
|
126
|
+
expect(cssVar('--a63-os-window-action-gap')).toBe('0.5rem')
|
|
127
|
+
expect(cssVar('--a63-os-window-control-style')).toBe('traffic')
|
|
128
|
+
// Compat alias for OS63 chrome
|
|
129
|
+
expect(cssVar('--os-window-action-width')).toBe('1.5rem')
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it('applies Windows caption geometry under [data-a63-os=windows]', () => {
|
|
133
|
+
const el = root()
|
|
134
|
+
el.setAttribute('data-a63-os', 'windows')
|
|
135
|
+
expect(cssVar('--a63-os-window-action-width')).toBe('2.875rem')
|
|
136
|
+
expect(cssVar('--a63-os-window-action-height')).toBe('100%')
|
|
137
|
+
expect(cssVar('--a63-os-window-action-gap')).toBe('0rem')
|
|
138
|
+
expect(cssVar('--a63-os-window-action-indicator-size')).toBe('100%')
|
|
139
|
+
expect(cssVar('--a63-os-window-control-style')).toBe('caption')
|
|
140
|
+
expect(cssVar('--os-window-action-width')).toBe('2.875rem')
|
|
141
|
+
expect(cssVar('--os-launcher-height')).toBe('3rem')
|
|
142
|
+
expect(cssVar('--a63-os-flyout-width-start-menu')).toBe('42rem')
|
|
143
|
+
expect(cssVar('--os-flyout-width-start-menu')).toBe('42rem')
|
|
144
|
+
expect(cssVar('--a63-os-caption-close-foreground')).not.toBe('')
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
it('restates macOS under [data-a63-os=macos]', () => {
|
|
148
|
+
const el = root()
|
|
149
|
+
el.setAttribute('data-a63-os', 'windows')
|
|
150
|
+
el.setAttribute('data-a63-os', 'macos')
|
|
151
|
+
expect(cssVar('--a63-os-window-action-width')).toBe('1.5rem')
|
|
152
|
+
expect(cssVar('--a63-os-control-side')).toBe('left')
|
|
153
|
+
})
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
describe('auto brand ramp', () => {
|
|
157
|
+
it('falls back to the b1 ramp when no --color-auto-* is set', () => {
|
|
158
|
+
const el = root()
|
|
159
|
+
el.setAttribute('data-a63-brand', 'auto')
|
|
160
|
+
// --a63-action-primary = --a63-brand-500 = var(--color-auto-500, var(--color-b1-500))
|
|
161
|
+
const primary = cssVar('--a63-action-primary')
|
|
162
|
+
const b1 = getComputedStyle(el).getPropertyValue('--color-b1-500').trim()
|
|
163
|
+
expect(primary).toBe(b1)
|
|
164
|
+
expect(primary).not.toBe('')
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
it('uses the extracted --color-auto ramp when present', () => {
|
|
168
|
+
const el = root()
|
|
169
|
+
el.setAttribute('data-a63-brand', 'auto')
|
|
170
|
+
el.style.setProperty('--color-auto-500', 'rgb(10, 20, 30)')
|
|
171
|
+
expect(cssVar('--a63-action-primary')).toBe('rgb(10, 20, 30)')
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
describe('design language axis', () => {
|
|
176
|
+
/**
|
|
177
|
+
* Resolve a control token through a real property — custom properties are
|
|
178
|
+
* substituted, not calc-evaluated, until something consumes them.
|
|
179
|
+
*/
|
|
180
|
+
function resolvedHeight(size: string): string {
|
|
181
|
+
const probe = document.createElement('div')
|
|
182
|
+
probe.style.height = `var(--a63-control-height-${size})`
|
|
183
|
+
document.body.appendChild(probe)
|
|
184
|
+
const value = getComputedStyle(probe).height
|
|
185
|
+
probe.remove()
|
|
186
|
+
return value
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
it('leaves the control ramp on the web defaults when unset', () => {
|
|
190
|
+
expect(resolvedHeight('xs')).toBe('24px')
|
|
191
|
+
expect(resolvedHeight('md')).toBe('32px')
|
|
192
|
+
expect(cssVar('--a63-control-font-weight')).toBe('500')
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
it('actually applies the iOS control ramp', () => {
|
|
196
|
+
// Regression guard: [data-a63-design-language] and control.css's `:root`
|
|
197
|
+
// have the SAME (0,1,0) specificity, so this only works while contracts/
|
|
198
|
+
// index.css imports control.css BEFORE environment.css. When that order was
|
|
199
|
+
// reversed the entire iOS design language was silently inert.
|
|
200
|
+
root().setAttribute('data-a63-design-language', 'ios')
|
|
201
|
+
|
|
202
|
+
expect(resolvedHeight('xs')).toBe('36px')
|
|
203
|
+
expect(resolvedHeight('sm')).toBe('40px')
|
|
204
|
+
expect(resolvedHeight('md')).toBe('44px')
|
|
205
|
+
expect(resolvedHeight('lg')).toBe('48px')
|
|
206
|
+
expect(resolvedHeight('xl')).toBe('52px')
|
|
207
|
+
expect(cssVar('--a63-control-font-weight')).toBe('600')
|
|
208
|
+
expect(cssVar('--a63-control-press-transform')).toBe('scale(0.97)')
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
it('tightens row block padding so rows land on the control ramp', () => {
|
|
212
|
+
// Web rows pad their way to height; iOS rows let the ramp floor them, which
|
|
213
|
+
// lands rows on the heights measured in shipping iOS apps (~44pt single
|
|
214
|
+
// line, ~59pt two-line). Apple publishes no iOS row height.
|
|
215
|
+
const probe = document.createElement('div')
|
|
216
|
+
probe.style.height = 'var(--a63-row-padding-block-md)'
|
|
217
|
+
document.body.appendChild(probe)
|
|
218
|
+
expect(getComputedStyle(probe).height).toBe('16px')
|
|
219
|
+
|
|
220
|
+
root().setAttribute('data-a63-design-language', 'ios')
|
|
221
|
+
expect(getComputedStyle(probe).height).toBe('8px')
|
|
222
|
+
probe.remove()
|
|
223
|
+
})
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
describe('input axis', () => {
|
|
227
|
+
it('separates the rendered floor from the interaction floor on touch', () => {
|
|
228
|
+
// Raising rendered geometry to the touch target is what collapsed xs/sm/md
|
|
229
|
+
// to a single 44px rung on every phone. See web-ios-token-parity.md.
|
|
230
|
+
root().setAttribute('data-a63-input', 'touch')
|
|
231
|
+
expect(cssVar('--a63-control-min-size')).toBe('2rem')
|
|
232
|
+
expect(cssVar('--a63-control-min-target')).toBe('2.75rem')
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
it('drops both floors back to the pointer minimum', () => {
|
|
236
|
+
root().setAttribute('data-a63-input', 'pointer')
|
|
237
|
+
expect(cssVar('--a63-control-min-size')).toBe('1.5rem')
|
|
238
|
+
expect(cssVar('--a63-control-min-target')).toBe('1.5rem')
|
|
239
|
+
})
|
|
240
|
+
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Radius contract.
|
|
3
|
+
*
|
|
4
|
+
* A stable intent name over the radius anchor/multiplier model for executable UI
|
|
5
|
+
* 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
|
+
/*
|
|
14
|
+
* Radius personalization axis.
|
|
15
|
+
*
|
|
16
|
+
* [data-a63-radius] sets the multiplier the whole --radius-* scale (foundation/
|
|
17
|
+
* radius.css) already multiplies by, so one attribute rescales every corner.
|
|
18
|
+
* `default` = 1 restates the foundation default so a subtree can override back.
|
|
19
|
+
*/
|
|
20
|
+
[data-a63-radius='none'] {
|
|
21
|
+
--a63-avatar-radius: 0;
|
|
22
|
+
--radius-multiplier: 0;
|
|
23
|
+
}
|
|
24
|
+
[data-a63-radius='subtle'] {
|
|
25
|
+
--a63-avatar-radius: var(--radius-full);
|
|
26
|
+
--radius-multiplier: 0.5;
|
|
27
|
+
}
|
|
28
|
+
[data-a63-radius='default'] {
|
|
29
|
+
--a63-avatar-radius: 50%;
|
|
30
|
+
--radius-multiplier: 1;
|
|
31
|
+
}
|
|
32
|
+
[data-a63-radius='round'] {
|
|
33
|
+
--a63-avatar-radius: 50%;
|
|
34
|
+
--radius-multiplier: 1.5;
|
|
35
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Canonical semantic layer.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of semantic truth for the new system. Values are
|
|
5
|
+
* sourced directly from the token foundation (surface aliases + primitives),
|
|
6
|
+
* with .dark overrides where the mode differs. shadcn (--background/--primary…)
|
|
7
|
+
* and Tailwind are opt-in adapters that re-reference THESE names — never the
|
|
8
|
+
* reverse. See packages/styles/README.md (the mirror rule).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
:root,
|
|
12
|
+
.light,
|
|
13
|
+
[data-a63-mode='light'] {
|
|
14
|
+
/* Surfaces — neutral, optionally bent toward the brand hue by --a63-surface-tint
|
|
15
|
+
(0% = pure neutral). Each mixes with a lightness-matched --a63-brand-* step. */
|
|
16
|
+
--a63-surface-page: color-mix(
|
|
17
|
+
in oklch,
|
|
18
|
+
var(--surface-light-2) calc(100% - var(--a63-surface-tint)),
|
|
19
|
+
var(--a63-brand-100) var(--a63-surface-tint)
|
|
20
|
+
);
|
|
21
|
+
--a63-surface-panel: color-mix(
|
|
22
|
+
in oklch,
|
|
23
|
+
var(--surface-light-1) calc(100% - var(--a63-surface-tint)),
|
|
24
|
+
var(--a63-brand-50) var(--a63-surface-tint)
|
|
25
|
+
);
|
|
26
|
+
--a63-surface-overlay: color-mix(
|
|
27
|
+
in oklch,
|
|
28
|
+
var(--surface-light-1) calc(100% - var(--a63-surface-tint)),
|
|
29
|
+
var(--a63-brand-50) var(--a63-surface-tint)
|
|
30
|
+
);
|
|
31
|
+
--a63-surface-muted: color-mix(
|
|
32
|
+
in oklch,
|
|
33
|
+
var(--surface-light-3) calc(100% - var(--a63-surface-tint)),
|
|
34
|
+
var(--a63-brand-200) var(--a63-surface-tint)
|
|
35
|
+
);
|
|
36
|
+
/* Recessed input surface (the field fill). Brightest surface in light mode so a
|
|
37
|
+
field reads as a clean well recessed into its panel via --a63-field-shadow. */
|
|
38
|
+
--a63-surface-control: color-mix(
|
|
39
|
+
in oklch,
|
|
40
|
+
var(--surface-light-1) calc(100% - var(--a63-surface-tint)),
|
|
41
|
+
var(--a63-brand-50) var(--a63-surface-tint)
|
|
42
|
+
);
|
|
43
|
+
/* Translucent hover plate. The BASE bends toward the brand hue by the surface
|
|
44
|
+
tint (same surface-4 -> brand-300 step as --a63-border-subtle) so it stays in
|
|
45
|
+
family on tinted themes instead of reading as a raw neutral grey; the outer
|
|
46
|
+
mix keeps the 20% translucency (value-identical at tint 0). */
|
|
47
|
+
--a63-surface-control-hover: color-mix(
|
|
48
|
+
in srgb,
|
|
49
|
+
color-mix(
|
|
50
|
+
in oklch,
|
|
51
|
+
var(--surface-light-4) calc(100% - var(--a63-surface-tint)),
|
|
52
|
+
var(--a63-brand-300) var(--a63-surface-tint)
|
|
53
|
+
),
|
|
54
|
+
transparent 20%
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
/* Text */
|
|
58
|
+
--a63-text-primary: var(--surface-light-12);
|
|
59
|
+
--a63-text-secondary: var(--surface-light-11);
|
|
60
|
+
|
|
61
|
+
/* Border */
|
|
62
|
+
--a63-border-subtle: color-mix(
|
|
63
|
+
in oklch,
|
|
64
|
+
var(--surface-light-4) calc(100% - var(--a63-surface-tint)),
|
|
65
|
+
var(--a63-brand-300) var(--a63-surface-tint)
|
|
66
|
+
);
|
|
67
|
+
--a63-border-control: color-mix(
|
|
68
|
+
in oklch,
|
|
69
|
+
var(--surface-light-5) calc(100% - var(--a63-surface-tint)),
|
|
70
|
+
var(--a63-brand-400) var(--a63-surface-tint)
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
/* Action — primary + focus ring live in tokens/brand.css (brand-ramp scoped).
|
|
74
|
+
Neutral = the default variant's fill; sourced from surfaces (NOT --a63-text-*)
|
|
75
|
+
so a theme can recolor text without turning the default button into a fill. */
|
|
76
|
+
--a63-action-neutral: var(--surface-light-12);
|
|
77
|
+
--a63-action-neutral-foreground: var(--surface-light-2);
|
|
78
|
+
--a63-action-danger: var(--color-danger-600);
|
|
79
|
+
--a63-action-danger-hover: color-mix(in oklch, var(--a63-action-danger) 90%, transparent);
|
|
80
|
+
--a63-action-danger-foreground: white;
|
|
81
|
+
|
|
82
|
+
/* Status (danger's status role is served by --a63-action-danger). The base is
|
|
83
|
+
the accent used for tinted callouts (bg = mix toward transparent, text/border
|
|
84
|
+
= the accent); -foreground is the text/icon color ON a SOLID status fill. */
|
|
85
|
+
--a63-status-info: var(--color-info-500);
|
|
86
|
+
--a63-status-info-foreground: white;
|
|
87
|
+
--a63-status-success: var(--color-success-500);
|
|
88
|
+
--a63-status-success-foreground: white;
|
|
89
|
+
--a63-status-warning: var(--color-warning-500);
|
|
90
|
+
--a63-status-warning-foreground: white;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Mode-agnostic semantics — same veil in light + dark, so declared once at :root
|
|
94
|
+
(the .dark block below never overrides them). */
|
|
95
|
+
:root {
|
|
96
|
+
/* Scrim — the modal/drawer/sheet backdrop veil behind overlays. */
|
|
97
|
+
--a63-scrim: color-mix(in oklch, black 40%, transparent);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:is(.dark, [data-a63-mode='dark']) {
|
|
101
|
+
--a63-surface-page: color-mix(
|
|
102
|
+
in oklch,
|
|
103
|
+
var(--surface-dark-1) calc(100% - var(--a63-surface-tint)),
|
|
104
|
+
var(--a63-brand-950) var(--a63-surface-tint)
|
|
105
|
+
);
|
|
106
|
+
--a63-surface-panel: color-mix(
|
|
107
|
+
in oklch,
|
|
108
|
+
var(--surface-dark-2) calc(100% - var(--a63-surface-tint)),
|
|
109
|
+
var(--a63-brand-900) var(--a63-surface-tint)
|
|
110
|
+
);
|
|
111
|
+
--a63-surface-overlay: color-mix(
|
|
112
|
+
in oklch,
|
|
113
|
+
var(--surface-dark-4) calc(100% - var(--a63-surface-tint)),
|
|
114
|
+
var(--a63-brand-800) var(--a63-surface-tint)
|
|
115
|
+
);
|
|
116
|
+
--a63-surface-muted: color-mix(
|
|
117
|
+
in oklch,
|
|
118
|
+
var(--surface-dark-3) calc(100% - var(--a63-surface-tint)),
|
|
119
|
+
var(--a63-brand-800) var(--a63-surface-tint)
|
|
120
|
+
);
|
|
121
|
+
/* Recessed input surface — darkest surface in dark mode, so a field reads as a
|
|
122
|
+
sunken well relative to its panel. */
|
|
123
|
+
--a63-surface-control: color-mix(
|
|
124
|
+
in oklch,
|
|
125
|
+
var(--surface-dark-1) calc(100% - var(--a63-surface-tint)),
|
|
126
|
+
var(--a63-brand-950) var(--a63-surface-tint)
|
|
127
|
+
);
|
|
128
|
+
/* Tint-aware translucent hover plate (dark) — surface-6 -> brand-600, matching
|
|
129
|
+
--a63-border-subtle; outer mix keeps the 20% translucency. */
|
|
130
|
+
--a63-surface-control-hover: color-mix(
|
|
131
|
+
in srgb,
|
|
132
|
+
color-mix(
|
|
133
|
+
in oklch,
|
|
134
|
+
var(--surface-dark-6) calc(100% - var(--a63-surface-tint)),
|
|
135
|
+
var(--a63-brand-600) var(--a63-surface-tint)
|
|
136
|
+
),
|
|
137
|
+
transparent 20%
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
--a63-text-primary: var(--surface-dark-12);
|
|
141
|
+
--a63-text-secondary: var(--surface-dark-11);
|
|
142
|
+
|
|
143
|
+
--a63-border-subtle: color-mix(
|
|
144
|
+
in oklch,
|
|
145
|
+
var(--surface-dark-6) calc(100% - var(--a63-surface-tint)),
|
|
146
|
+
var(--a63-brand-600) var(--a63-surface-tint)
|
|
147
|
+
);
|
|
148
|
+
--a63-border-control: color-mix(
|
|
149
|
+
in oklch,
|
|
150
|
+
var(--surface-dark-7) calc(100% - var(--a63-surface-tint)),
|
|
151
|
+
var(--a63-brand-500) var(--a63-surface-tint)
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
--a63-action-neutral: var(--surface-dark-12);
|
|
155
|
+
--a63-action-neutral-foreground: var(--surface-dark-1);
|
|
156
|
+
--a63-action-danger-hover: color-mix(in oklch, var(--a63-action-danger) 82%, white 8%);
|
|
157
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Space contract.
|
|
3
|
+
*
|
|
4
|
+
* A proportional unit + the compact set of aliases the system actually uses, so
|
|
5
|
+
* density can tune rhythm without component-local spacing scales. Raw --spacing-*
|
|
6
|
+
* primitives remain available for anything outside this set.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
:root {
|
|
10
|
+
--a63-space-unit: var(--spacing-1);
|
|
11
|
+
--a63-space-0_5: calc(var(--a63-space-unit) * 0.5);
|
|
12
|
+
--a63-space-1: var(--a63-space-unit);
|
|
13
|
+
--a63-space-1_5: calc(var(--a63-space-unit) * 1.5);
|
|
14
|
+
--a63-space-2: calc(var(--a63-space-unit) * 2);
|
|
15
|
+
--a63-space-2_5: calc(var(--a63-space-unit) * 2.5);
|
|
16
|
+
--a63-space-3: calc(var(--a63-space-unit) * 3);
|
|
17
|
+
--a63-space-3_5: calc(var(--a63-space-unit) * 3.5);
|
|
18
|
+
--a63-space-4: calc(var(--a63-space-unit) * 4);
|
|
19
|
+
--a63-space-5: calc(var(--a63-space-unit) * 5);
|
|
20
|
+
--a63-space-6: calc(var(--a63-space-unit) * 6);
|
|
21
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Surface (neutral) axis.
|
|
3
|
+
*
|
|
4
|
+
* Two personalization knobs for the neutrals:
|
|
5
|
+
* 1. PALETTE — [data-a63-surface="n1".."n6"] remaps the neutral ramp
|
|
6
|
+
* (--surface-light-* / --surface-dark-*) to one of the six neutral palettes.
|
|
7
|
+
* 2. TINT — --a63-surface-tint (0%..100%) bends the neutrals toward the brand
|
|
8
|
+
* hue. Rather than mixing all 24 raw ramp stops (as a Tailwind app would), we
|
|
9
|
+
* mix only the ~6 SEMANTIC surface/border tokens the system actually consumes,
|
|
10
|
+
* in tokens/semantics.css, each toward a lightness-matched --a63-brand-* step.
|
|
11
|
+
* That's ~12 color-mixes instead of 144, and it "just works" because those
|
|
12
|
+
* tokens sit at the mode scope, co-located with surface + brand + tint on the
|
|
13
|
+
* personalization root. Themes that fully re-skin surfaces (aqua/terminal)
|
|
14
|
+
* define their own surface identity and do not receive the brand tint.
|
|
15
|
+
*
|
|
16
|
+
* n1 is the default palette (matches tokens/foundation/aliases.css); tint 0 = neutral.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
:root {
|
|
20
|
+
--a63-surface-tint: 0%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:root,
|
|
24
|
+
[data-a63-surface='n1'] {
|
|
25
|
+
--surface-light-1: var(--color-n1-light-1);
|
|
26
|
+
--surface-light-2: var(--color-n1-light-2);
|
|
27
|
+
--surface-light-3: var(--color-n1-light-3);
|
|
28
|
+
--surface-light-4: var(--color-n1-light-4);
|
|
29
|
+
--surface-light-5: var(--color-n1-light-5);
|
|
30
|
+
--surface-light-6: var(--color-n1-light-6);
|
|
31
|
+
--surface-light-7: var(--color-n1-light-7);
|
|
32
|
+
--surface-light-8: var(--color-n1-light-8);
|
|
33
|
+
--surface-light-9: var(--color-n1-light-9);
|
|
34
|
+
--surface-light-10: var(--color-n1-light-10);
|
|
35
|
+
--surface-light-11: var(--color-n1-light-11);
|
|
36
|
+
--surface-light-12: var(--color-n1-light-12);
|
|
37
|
+
--surface-dark-1: var(--color-n1-dark-1);
|
|
38
|
+
--surface-dark-2: var(--color-n1-dark-2);
|
|
39
|
+
--surface-dark-3: var(--color-n1-dark-3);
|
|
40
|
+
--surface-dark-4: var(--color-n1-dark-4);
|
|
41
|
+
--surface-dark-5: var(--color-n1-dark-5);
|
|
42
|
+
--surface-dark-6: var(--color-n1-dark-6);
|
|
43
|
+
--surface-dark-7: var(--color-n1-dark-7);
|
|
44
|
+
--surface-dark-8: var(--color-n1-dark-8);
|
|
45
|
+
--surface-dark-9: var(--color-n1-dark-9);
|
|
46
|
+
--surface-dark-10: var(--color-n1-dark-10);
|
|
47
|
+
--surface-dark-11: var(--color-n1-dark-11);
|
|
48
|
+
--surface-dark-12: var(--color-n1-dark-12);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[data-a63-surface='n2'] {
|
|
52
|
+
--surface-light-1: var(--color-n2-light-1);
|
|
53
|
+
--surface-light-2: var(--color-n2-light-2);
|
|
54
|
+
--surface-light-3: var(--color-n2-light-3);
|
|
55
|
+
--surface-light-4: var(--color-n2-light-4);
|
|
56
|
+
--surface-light-5: var(--color-n2-light-5);
|
|
57
|
+
--surface-light-6: var(--color-n2-light-6);
|
|
58
|
+
--surface-light-7: var(--color-n2-light-7);
|
|
59
|
+
--surface-light-8: var(--color-n2-light-8);
|
|
60
|
+
--surface-light-9: var(--color-n2-light-9);
|
|
61
|
+
--surface-light-10: var(--color-n2-light-10);
|
|
62
|
+
--surface-light-11: var(--color-n2-light-11);
|
|
63
|
+
--surface-light-12: var(--color-n2-light-12);
|
|
64
|
+
--surface-dark-1: var(--color-n2-dark-1);
|
|
65
|
+
--surface-dark-2: var(--color-n2-dark-2);
|
|
66
|
+
--surface-dark-3: var(--color-n2-dark-3);
|
|
67
|
+
--surface-dark-4: var(--color-n2-dark-4);
|
|
68
|
+
--surface-dark-5: var(--color-n2-dark-5);
|
|
69
|
+
--surface-dark-6: var(--color-n2-dark-6);
|
|
70
|
+
--surface-dark-7: var(--color-n2-dark-7);
|
|
71
|
+
--surface-dark-8: var(--color-n2-dark-8);
|
|
72
|
+
--surface-dark-9: var(--color-n2-dark-9);
|
|
73
|
+
--surface-dark-10: var(--color-n2-dark-10);
|
|
74
|
+
--surface-dark-11: var(--color-n2-dark-11);
|
|
75
|
+
--surface-dark-12: var(--color-n2-dark-12);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
[data-a63-surface='n3'] {
|
|
79
|
+
--surface-light-1: var(--color-n3-light-1);
|
|
80
|
+
--surface-light-2: var(--color-n3-light-2);
|
|
81
|
+
--surface-light-3: var(--color-n3-light-3);
|
|
82
|
+
--surface-light-4: var(--color-n3-light-4);
|
|
83
|
+
--surface-light-5: var(--color-n3-light-5);
|
|
84
|
+
--surface-light-6: var(--color-n3-light-6);
|
|
85
|
+
--surface-light-7: var(--color-n3-light-7);
|
|
86
|
+
--surface-light-8: var(--color-n3-light-8);
|
|
87
|
+
--surface-light-9: var(--color-n3-light-9);
|
|
88
|
+
--surface-light-10: var(--color-n3-light-10);
|
|
89
|
+
--surface-light-11: var(--color-n3-light-11);
|
|
90
|
+
--surface-light-12: var(--color-n3-light-12);
|
|
91
|
+
--surface-dark-1: var(--color-n3-dark-1);
|
|
92
|
+
--surface-dark-2: var(--color-n3-dark-2);
|
|
93
|
+
--surface-dark-3: var(--color-n3-dark-3);
|
|
94
|
+
--surface-dark-4: var(--color-n3-dark-4);
|
|
95
|
+
--surface-dark-5: var(--color-n3-dark-5);
|
|
96
|
+
--surface-dark-6: var(--color-n3-dark-6);
|
|
97
|
+
--surface-dark-7: var(--color-n3-dark-7);
|
|
98
|
+
--surface-dark-8: var(--color-n3-dark-8);
|
|
99
|
+
--surface-dark-9: var(--color-n3-dark-9);
|
|
100
|
+
--surface-dark-10: var(--color-n3-dark-10);
|
|
101
|
+
--surface-dark-11: var(--color-n3-dark-11);
|
|
102
|
+
--surface-dark-12: var(--color-n3-dark-12);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-a63-surface='n4'] {
|
|
106
|
+
--surface-light-1: var(--color-n4-light-1);
|
|
107
|
+
--surface-light-2: var(--color-n4-light-2);
|
|
108
|
+
--surface-light-3: var(--color-n4-light-3);
|
|
109
|
+
--surface-light-4: var(--color-n4-light-4);
|
|
110
|
+
--surface-light-5: var(--color-n4-light-5);
|
|
111
|
+
--surface-light-6: var(--color-n4-light-6);
|
|
112
|
+
--surface-light-7: var(--color-n4-light-7);
|
|
113
|
+
--surface-light-8: var(--color-n4-light-8);
|
|
114
|
+
--surface-light-9: var(--color-n4-light-9);
|
|
115
|
+
--surface-light-10: var(--color-n4-light-10);
|
|
116
|
+
--surface-light-11: var(--color-n4-light-11);
|
|
117
|
+
--surface-light-12: var(--color-n4-light-12);
|
|
118
|
+
--surface-dark-1: var(--color-n4-dark-1);
|
|
119
|
+
--surface-dark-2: var(--color-n4-dark-2);
|
|
120
|
+
--surface-dark-3: var(--color-n4-dark-3);
|
|
121
|
+
--surface-dark-4: var(--color-n4-dark-4);
|
|
122
|
+
--surface-dark-5: var(--color-n4-dark-5);
|
|
123
|
+
--surface-dark-6: var(--color-n4-dark-6);
|
|
124
|
+
--surface-dark-7: var(--color-n4-dark-7);
|
|
125
|
+
--surface-dark-8: var(--color-n4-dark-8);
|
|
126
|
+
--surface-dark-9: var(--color-n4-dark-9);
|
|
127
|
+
--surface-dark-10: var(--color-n4-dark-10);
|
|
128
|
+
--surface-dark-11: var(--color-n4-dark-11);
|
|
129
|
+
--surface-dark-12: var(--color-n4-dark-12);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
[data-a63-surface='n5'] {
|
|
133
|
+
--surface-light-1: var(--color-n5-light-1);
|
|
134
|
+
--surface-light-2: var(--color-n5-light-2);
|
|
135
|
+
--surface-light-3: var(--color-n5-light-3);
|
|
136
|
+
--surface-light-4: var(--color-n5-light-4);
|
|
137
|
+
--surface-light-5: var(--color-n5-light-5);
|
|
138
|
+
--surface-light-6: var(--color-n5-light-6);
|
|
139
|
+
--surface-light-7: var(--color-n5-light-7);
|
|
140
|
+
--surface-light-8: var(--color-n5-light-8);
|
|
141
|
+
--surface-light-9: var(--color-n5-light-9);
|
|
142
|
+
--surface-light-10: var(--color-n5-light-10);
|
|
143
|
+
--surface-light-11: var(--color-n5-light-11);
|
|
144
|
+
--surface-light-12: var(--color-n5-light-12);
|
|
145
|
+
--surface-dark-1: var(--color-n5-dark-1);
|
|
146
|
+
--surface-dark-2: var(--color-n5-dark-2);
|
|
147
|
+
--surface-dark-3: var(--color-n5-dark-3);
|
|
148
|
+
--surface-dark-4: var(--color-n5-dark-4);
|
|
149
|
+
--surface-dark-5: var(--color-n5-dark-5);
|
|
150
|
+
--surface-dark-6: var(--color-n5-dark-6);
|
|
151
|
+
--surface-dark-7: var(--color-n5-dark-7);
|
|
152
|
+
--surface-dark-8: var(--color-n5-dark-8);
|
|
153
|
+
--surface-dark-9: var(--color-n5-dark-9);
|
|
154
|
+
--surface-dark-10: var(--color-n5-dark-10);
|
|
155
|
+
--surface-dark-11: var(--color-n5-dark-11);
|
|
156
|
+
--surface-dark-12: var(--color-n5-dark-12);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
[data-a63-surface='n6'] {
|
|
160
|
+
--surface-light-1: var(--color-n6-light-1);
|
|
161
|
+
--surface-light-2: var(--color-n6-light-2);
|
|
162
|
+
--surface-light-3: var(--color-n6-light-3);
|
|
163
|
+
--surface-light-4: var(--color-n6-light-4);
|
|
164
|
+
--surface-light-5: var(--color-n6-light-5);
|
|
165
|
+
--surface-light-6: var(--color-n6-light-6);
|
|
166
|
+
--surface-light-7: var(--color-n6-light-7);
|
|
167
|
+
--surface-light-8: var(--color-n6-light-8);
|
|
168
|
+
--surface-light-9: var(--color-n6-light-9);
|
|
169
|
+
--surface-light-10: var(--color-n6-light-10);
|
|
170
|
+
--surface-light-11: var(--color-n6-light-11);
|
|
171
|
+
--surface-light-12: var(--color-n6-light-12);
|
|
172
|
+
--surface-dark-1: var(--color-n6-dark-1);
|
|
173
|
+
--surface-dark-2: var(--color-n6-dark-2);
|
|
174
|
+
--surface-dark-3: var(--color-n6-dark-3);
|
|
175
|
+
--surface-dark-4: var(--color-n6-dark-4);
|
|
176
|
+
--surface-dark-5: var(--color-n6-dark-5);
|
|
177
|
+
--surface-dark-6: var(--color-n6-dark-6);
|
|
178
|
+
--surface-dark-7: var(--color-n6-dark-7);
|
|
179
|
+
--surface-dark-8: var(--color-n6-dark-8);
|
|
180
|
+
--surface-dark-9: var(--color-n6-dark-9);
|
|
181
|
+
--surface-dark-10: var(--color-n6-dark-10);
|
|
182
|
+
--surface-dark-11: var(--color-n6-dark-11);
|
|
183
|
+
--surface-dark-12: var(--color-n6-dark-12);
|
|
184
|
+
}
|