@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
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it } from 'vitest'
|
|
2
|
+
import { resetRoot, root } from '../test/apply-styles'
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* [data-a63-density] (contracts/environment.css) sets --a63-space-unit. The
|
|
6
|
+
* space steps, control heights, paddings and gaps are built on it at :root, and
|
|
7
|
+
* a custom property that reads another resolves where it is declared, so the
|
|
8
|
+
* density scope declares them again. These probes check what a nested element
|
|
9
|
+
* renders with, on <html> and on a nested scope (UIProvider density="compact").
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const scopes: HTMLElement[] = []
|
|
13
|
+
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
for (const scope of scopes.splice(0)) scope.remove()
|
|
16
|
+
root().removeAttribute('data-a63-density')
|
|
17
|
+
resetRoot()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
function scope(attributes: Record<string, string> = {}, parent: HTMLElement = document.body) {
|
|
21
|
+
const element = document.createElement('div')
|
|
22
|
+
for (const [name, value] of Object.entries(attributes)) element.setAttribute(name, value)
|
|
23
|
+
parent.appendChild(element)
|
|
24
|
+
if (parent === document.body) scopes.push(element)
|
|
25
|
+
return element
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The px a nested element renders `height: <expression>` at. */
|
|
29
|
+
function height(parent: HTMLElement, expression: string): string {
|
|
30
|
+
const probe = document.createElement('div')
|
|
31
|
+
probe.style.height = expression
|
|
32
|
+
parent.appendChild(probe)
|
|
33
|
+
return getComputedStyle(probe).height
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const token = (name: string) => `var(${name})`
|
|
37
|
+
/** The height a control recipe draws a size at (button.css, input.css and the rest). */
|
|
38
|
+
const controlHeight = (size: string) =>
|
|
39
|
+
`max(calc(var(--a63-control-height-${size}) * var(--a63-density-scale, 1)), var(--a63-control-min-size))`
|
|
40
|
+
|
|
41
|
+
/** What compact density renders at: the 4px unit becomes 3.5px, once. */
|
|
42
|
+
function expectCompact(element: HTMLElement) {
|
|
43
|
+
expect(height(element, token('--a63-space-unit'))).toBe('3.5px')
|
|
44
|
+
expect(height(element, token('--a63-space-4'))).toBe('14px')
|
|
45
|
+
expect(height(element, token('--a63-space-1_5'))).toBe('5.25px')
|
|
46
|
+
expect(height(element, token('--a63-control-height-md'))).toBe('28px')
|
|
47
|
+
expect(height(element, controlHeight('md'))).toBe('28px')
|
|
48
|
+
expect(height(element, controlHeight('lg'))).toBe('32px')
|
|
49
|
+
// xs is 21px, so the 24px pointer floor holds it.
|
|
50
|
+
expect(height(element, controlHeight('xs'))).toBe('24px')
|
|
51
|
+
expect(height(element, token('--a63-control-padding-inline-md'))).toBe('10.5px')
|
|
52
|
+
expect(height(element, token('--a63-control-gap'))).toBe('7px')
|
|
53
|
+
expect(height(element, token('--a63-trigger-gap'))).toBe('7px')
|
|
54
|
+
expect(height(element, token('--a63-row-padding-block-sm'))).toBe('11px')
|
|
55
|
+
expect(height(element, token('--a63-menu-item-padding-inline'))).toBe('7px')
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function expectComfortable(element: HTMLElement) {
|
|
59
|
+
expect(height(element, token('--a63-space-4'))).toBe('16px')
|
|
60
|
+
expect(height(element, controlHeight('md'))).toBe('32px')
|
|
61
|
+
expect(height(element, token('--a63-control-padding-inline-md'))).toBe('12px')
|
|
62
|
+
expect(height(element, token('--a63-row-padding-block-sm'))).toBe('12px')
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
describe('density', () => {
|
|
66
|
+
it('leaves the default sizes alone', () => {
|
|
67
|
+
expectComfortable(scope())
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('compact on <html> scales spacing and control heights once', () => {
|
|
71
|
+
root().setAttribute('data-a63-density', 'compact')
|
|
72
|
+
expectCompact(scope())
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it('compact on a nested scope scales spacing and control heights the same way', () => {
|
|
76
|
+
expectCompact(scope({ 'data-a63-density': 'compact' }))
|
|
77
|
+
// The legacy attribute name works too.
|
|
78
|
+
expectCompact(scope({ 'data-density': 'compact' }))
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
it('a nested comfortable scope restores the default sizes under a compact root', () => {
|
|
82
|
+
root().setAttribute('data-a63-density', 'compact')
|
|
83
|
+
expectComfortable(scope({ 'data-a63-density': 'comfortable' }))
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it('keeps the iOS height ramp in a compact scope inside the iOS design language', () => {
|
|
87
|
+
const ios = scope({ 'data-a63-design-language': 'ios' })
|
|
88
|
+
const compact = scope({ 'data-a63-density': 'compact' }, ios)
|
|
89
|
+
// iOS md is 11 units: 44px, and 38.5px at the compact unit, rounded to 39px.
|
|
90
|
+
expect(height(ios, controlHeight('md'))).toBe('44px')
|
|
91
|
+
expect(height(compact, controlHeight('md'))).toBe('39px')
|
|
92
|
+
expect(height(compact, token('--a63-control-padding-inline-md'))).toBe('14px')
|
|
93
|
+
// On the same element.
|
|
94
|
+
const both = scope({ 'data-a63-design-language': 'ios', 'data-a63-density': 'compact' })
|
|
95
|
+
expect(height(both, controlHeight('md'))).toBe('39px')
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it('keeps the phone sizes in a compact scope inside a phone screen', () => {
|
|
99
|
+
const phone = scope({ 'data-a63-form-factor': 'phone' })
|
|
100
|
+
const compact = scope({ 'data-a63-density': 'compact' }, phone)
|
|
101
|
+
expect(height(compact, controlHeight('md'))).toBe('39px')
|
|
102
|
+
expect(height(compact, token('--a63-inset-row-min-size'))).toBe('46px')
|
|
103
|
+
expect(getComputedStyle(compact).getPropertyValue('--a63-control-font-size-md').trim()).toBe(
|
|
104
|
+
getComputedStyle(phone).getPropertyValue('--a63-control-font-size-md').trim()
|
|
105
|
+
)
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
it('lands every control height and row padding on whole pixels in every density', () => {
|
|
109
|
+
const sizes = ['xs', 'sm', 'md', 'lg', 'xl']
|
|
110
|
+
const tokens = [
|
|
111
|
+
...sizes.map(size => token(`--a63-control-height-${size}`)),
|
|
112
|
+
...sizes.map(controlHeight),
|
|
113
|
+
...['xs', 'sm', 'md'].map(size => token(`--a63-row-padding-block-${size}`)),
|
|
114
|
+
]
|
|
115
|
+
for (const density of ['compact', 'comfortable', undefined]) {
|
|
116
|
+
for (const scopeAttributes of [
|
|
117
|
+
{},
|
|
118
|
+
{ 'data-a63-design-language': 'ios' },
|
|
119
|
+
{ 'data-a63-form-factor': 'phone' },
|
|
120
|
+
]) {
|
|
121
|
+
const element = scope({
|
|
122
|
+
...scopeAttributes,
|
|
123
|
+
...(density ? { 'data-a63-density': density } : {}),
|
|
124
|
+
})
|
|
125
|
+
for (const expression of [
|
|
126
|
+
...tokens,
|
|
127
|
+
...(scopeAttributes['data-a63-form-factor' as keyof typeof scopeAttributes]
|
|
128
|
+
? [token('--a63-inset-row-min-size')]
|
|
129
|
+
: []),
|
|
130
|
+
]) {
|
|
131
|
+
const px = Number.parseFloat(height(element, expression))
|
|
132
|
+
expect(
|
|
133
|
+
Number.isInteger(px),
|
|
134
|
+
`${expression} in ${density} ${JSON.stringify(scopeAttributes)}: ${px}`
|
|
135
|
+
).toBe(true)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
it('does not change text sizes', () => {
|
|
142
|
+
const compact = scope({ 'data-a63-density': 'compact' })
|
|
143
|
+
const probe = document.createElement('span')
|
|
144
|
+
probe.style.fontSize = 'var(--a63-control-font-size-md)'
|
|
145
|
+
compact.appendChild(probe)
|
|
146
|
+
expect(getComputedStyle(probe).fontSize).toBe('13px')
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
describe('root text', () => {
|
|
151
|
+
it('sets text without a size class to the body role, and keeps 1rem at 16px', () => {
|
|
152
|
+
const text = document.createElement('p')
|
|
153
|
+
document.body.appendChild(text)
|
|
154
|
+
expect(getComputedStyle(text).fontSize).toBe('15px')
|
|
155
|
+
expect(getComputedStyle(text).lineHeight).toBe('23px')
|
|
156
|
+
expect(getComputedStyle(document.documentElement).fontSize).toBe('16px')
|
|
157
|
+
text.remove()
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
it('sets the phone body role inside a phone screen', () => {
|
|
161
|
+
const phone = scope({ 'data-a63-form-factor': 'phone' })
|
|
162
|
+
const text = document.createElement('p')
|
|
163
|
+
phone.appendChild(text)
|
|
164
|
+
expect(getComputedStyle(text).fontSize).toBe('17px')
|
|
165
|
+
expect(getComputedStyle(text).lineHeight).toBe('22px')
|
|
166
|
+
})
|
|
167
|
+
})
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it } from 'vitest'
|
|
2
|
+
import { resetRoot, root } from '../test/apply-styles'
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* [data-a63-form-factor='phone'] (contracts/environment.css) gives a subtree
|
|
6
|
+
* the type steps and control sizing of a phone screen. Custom properties that
|
|
7
|
+
* read other custom properties resolve where they are declared, so these
|
|
8
|
+
* probes check the values a nested element actually renders with.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const scopes: HTMLElement[] = []
|
|
12
|
+
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
for (const scope of scopes.splice(0)) scope.remove()
|
|
15
|
+
resetRoot()
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
function scope(attributes: Record<string, string> = {}): HTMLElement {
|
|
19
|
+
const element = document.createElement('div')
|
|
20
|
+
for (const [name, value] of Object.entries(attributes)) element.setAttribute(name, value)
|
|
21
|
+
document.body.appendChild(element)
|
|
22
|
+
scopes.push(element)
|
|
23
|
+
return element
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** The px a nested element renders `font-size: var(<name>)` at. */
|
|
27
|
+
function fontSize(parent: HTMLElement, name: string): string {
|
|
28
|
+
const probe = document.createElement('span')
|
|
29
|
+
probe.style.fontSize = `var(${name})`
|
|
30
|
+
parent.appendChild(probe)
|
|
31
|
+
return getComputedStyle(probe).fontSize
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The px a nested element renders `height: var(<name>)` at. */
|
|
35
|
+
function height(parent: HTMLElement, name: string): string {
|
|
36
|
+
const probe = document.createElement('div')
|
|
37
|
+
probe.style.height = `var(${name})`
|
|
38
|
+
parent.appendChild(probe)
|
|
39
|
+
return getComputedStyle(probe).height
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The px a nested element renders `width: <expression>` at. */
|
|
43
|
+
function width(parent: HTMLElement, expression: string): string {
|
|
44
|
+
const probe = document.createElement('div')
|
|
45
|
+
probe.style.width = expression
|
|
46
|
+
parent.appendChild(probe)
|
|
47
|
+
return getComputedStyle(probe).width
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
describe('phone form factor', () => {
|
|
51
|
+
it('sets the iOS text sizes on the type steps', () => {
|
|
52
|
+
const phone = scope({ 'data-a63-form-factor': 'phone' })
|
|
53
|
+
expect(fontSize(phone, '--typography-base-font-size')).toBe('17px')
|
|
54
|
+
expect(fontSize(phone, '--typography-sm-font-size')).toBe('15px')
|
|
55
|
+
expect(fontSize(phone, '--typography-xs-font-size')).toBe('13px')
|
|
56
|
+
expect(fontSize(phone, '--typography-2xs-font-size')).toBe('11px')
|
|
57
|
+
expect(fontSize(phone, '--typography-6xl-font-size')).toBe('34px')
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it('redeclares the text roles, so they follow the phone steps', () => {
|
|
61
|
+
const phone = scope({ 'data-a63-form-factor': 'phone' })
|
|
62
|
+
expect(fontSize(phone, '--a63-type-body-font-size')).toBe('17px')
|
|
63
|
+
expect(fontSize(phone, '--a63-type-headline-font-size')).toBe('17px')
|
|
64
|
+
expect(fontSize(phone, '--a63-type-subhead-font-size')).toBe('15px')
|
|
65
|
+
expect(fontSize(phone, '--a63-type-footnote-font-size')).toBe('13px')
|
|
66
|
+
expect(fontSize(phone, '--a63-type-title-2-font-size')).toBe('22px')
|
|
67
|
+
expect(fontSize(phone, '--a63-type-large-title-font-size')).toBe('34px')
|
|
68
|
+
expect(fontSize(phone, '--a63-type-display-font-size')).toBe('40px')
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it('sets control labels at body size and the iOS height ramp', () => {
|
|
72
|
+
const phone = scope({ 'data-a63-form-factor': 'phone' })
|
|
73
|
+
expect(fontSize(phone, '--a63-control-font-size-xs')).toBe('13px')
|
|
74
|
+
expect(fontSize(phone, '--a63-control-font-size-sm')).toBe('17px')
|
|
75
|
+
expect(fontSize(phone, '--a63-control-font-size-md')).toBe('17px')
|
|
76
|
+
expect(height(phone, '--a63-control-height-sm')).toBe('40px')
|
|
77
|
+
expect(height(phone, '--a63-control-height-md')).toBe('44px')
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
it('keeps a secondary line below its title: subheadline size on a phone, sm elsewhere', () => {
|
|
81
|
+
const secondary = '--a63-control-font-size-secondary, var(--a63-control-font-size-sm)'
|
|
82
|
+
const phone = scope({ 'data-a63-form-factor': 'phone' })
|
|
83
|
+
expect(fontSize(phone, secondary)).toBe('15px')
|
|
84
|
+
expect(fontSize(phone, '--a63-control-font-size-sm')).toBe('17px')
|
|
85
|
+
expect(fontSize(scope(), secondary)).toBe('12px')
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
it('gives the switch the iOS 26 proportions: a wide pill knob on a 63 by 28 track', () => {
|
|
89
|
+
// The Switch recipe's track: thumb × (1 + aspect) + 6px wide, thumb + 6px tall.
|
|
90
|
+
const track = 'calc(var(--a63-switch-thumb-size) * (1 + var(--a63-switch-thumb-aspect)) + 6px)'
|
|
91
|
+
const phone = scope({ 'data-a63-form-factor': 'phone' })
|
|
92
|
+
expect(height(phone, '--a63-switch-thumb-size')).toBe('22px')
|
|
93
|
+
expect(Number.parseFloat(width(phone, track))).toBeCloseTo(63.2, 1)
|
|
94
|
+
const web = scope()
|
|
95
|
+
expect(height(web, '--a63-switch-thumb-size')).toBe('16px')
|
|
96
|
+
expect(width(web, track)).toBe('38px')
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
it('gives a grouped list the iOS row height and a rounder card, on a phone only', () => {
|
|
100
|
+
const phone = scope({ 'data-a63-form-factor': 'phone' })
|
|
101
|
+
expect(height(phone, '--a63-inset-row-min-size')).toBe('52px')
|
|
102
|
+
expect(height(phone, '--a63-inset-group-radius')).toBe('18px')
|
|
103
|
+
// Outside a phone neither is declared, so the Item recipe takes its fallbacks.
|
|
104
|
+
const web = getComputedStyle(scope())
|
|
105
|
+
expect(web.getPropertyValue('--a63-inset-row-min-size')).toBe('')
|
|
106
|
+
expect(web.getPropertyValue('--a63-inset-group-radius')).toBe('')
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
it('leaves the page outside the phone scope on the web sizes', () => {
|
|
110
|
+
const web = scope()
|
|
111
|
+
expect(fontSize(web, '--typography-base-font-size')).toBe('15px')
|
|
112
|
+
expect(fontSize(web, '--a63-type-body-font-size')).toBe('15px')
|
|
113
|
+
expect(fontSize(web, '--a63-control-font-size-md')).toBe('13px')
|
|
114
|
+
expect(height(web, '--a63-control-height-md')).toBe('32px')
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it('keeps the type scale preference on top of the phone steps', () => {
|
|
118
|
+
root().setAttribute('data-a63-type-scale', 'large')
|
|
119
|
+
const phone = scope({ 'data-a63-form-factor': 'phone' })
|
|
120
|
+
// 17px × 1.2
|
|
121
|
+
expect(fontSize(phone, '--a63-type-body-font-size')).toBe('20.4px')
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it('wins over the design language on the same element', () => {
|
|
125
|
+
const phone = scope({ 'data-a63-design-language': 'ios', 'data-a63-form-factor': 'phone' })
|
|
126
|
+
expect(fontSize(phone, '--a63-control-font-size-sm')).toBe('17px')
|
|
127
|
+
expect(height(phone, '--a63-control-height-md')).toBe('44px')
|
|
128
|
+
})
|
|
129
|
+
})
|
|
@@ -333,36 +333,6 @@
|
|
|
333
333
|
--screen-iphone-16-pro: 402px;
|
|
334
334
|
--screen-macbook-air: 1280px;
|
|
335
335
|
--screen-macbook-pro-16: 1728px;
|
|
336
|
-
--size-0: 0px;
|
|
337
|
-
--size-1: 4px;
|
|
338
|
-
--size-2: 8px;
|
|
339
|
-
--size-3: 12px;
|
|
340
|
-
--size-4: 16px;
|
|
341
|
-
--size-5: 20px;
|
|
342
|
-
--size-6: 24px;
|
|
343
|
-
--size-7: 28px;
|
|
344
|
-
--size-8: 32px;
|
|
345
|
-
--size-9: 36px;
|
|
346
|
-
--size-10: 40px;
|
|
347
|
-
--size-11: 44px;
|
|
348
|
-
--size-12: 48px;
|
|
349
|
-
--size-14: 56px;
|
|
350
|
-
--size-16: 64px;
|
|
351
|
-
--size-20: 80px;
|
|
352
|
-
--size-24: 96px;
|
|
353
|
-
--size-28: 112px;
|
|
354
|
-
--size-32: 128px;
|
|
355
|
-
--size-36: 144px;
|
|
356
|
-
--size-40: 160px;
|
|
357
|
-
--size-44: 176px;
|
|
358
|
-
--size-48: 192px;
|
|
359
|
-
--size-52: 208px;
|
|
360
|
-
--size-56: 224px;
|
|
361
|
-
--size-60: 240px;
|
|
362
|
-
--size-64: 256px;
|
|
363
|
-
--size-72: 288px;
|
|
364
|
-
--size-80: 320px;
|
|
365
|
-
--size-96: 384px;
|
|
366
336
|
--spacing-0: 0px;
|
|
367
337
|
--spacing-1: 4px;
|
|
368
338
|
--spacing-2: 8px;
|
|
@@ -2897,218 +2897,6 @@
|
|
|
2897
2897
|
}
|
|
2898
2898
|
}
|
|
2899
2899
|
},
|
|
2900
|
-
"size": {
|
|
2901
|
-
"0": {
|
|
2902
|
-
"$type": "dimension",
|
|
2903
|
-
"$value": {
|
|
2904
|
-
"value": 0,
|
|
2905
|
-
"unit": "px"
|
|
2906
|
-
}
|
|
2907
|
-
},
|
|
2908
|
-
"1": {
|
|
2909
|
-
"$type": "dimension",
|
|
2910
|
-
"$value": {
|
|
2911
|
-
"value": 4,
|
|
2912
|
-
"unit": "px"
|
|
2913
|
-
}
|
|
2914
|
-
},
|
|
2915
|
-
"2": {
|
|
2916
|
-
"$type": "dimension",
|
|
2917
|
-
"$value": {
|
|
2918
|
-
"value": 8,
|
|
2919
|
-
"unit": "px"
|
|
2920
|
-
}
|
|
2921
|
-
},
|
|
2922
|
-
"3": {
|
|
2923
|
-
"$type": "dimension",
|
|
2924
|
-
"$value": {
|
|
2925
|
-
"value": 12,
|
|
2926
|
-
"unit": "px"
|
|
2927
|
-
}
|
|
2928
|
-
},
|
|
2929
|
-
"4": {
|
|
2930
|
-
"$type": "dimension",
|
|
2931
|
-
"$value": {
|
|
2932
|
-
"value": 16,
|
|
2933
|
-
"unit": "px"
|
|
2934
|
-
}
|
|
2935
|
-
},
|
|
2936
|
-
"5": {
|
|
2937
|
-
"$type": "dimension",
|
|
2938
|
-
"$value": {
|
|
2939
|
-
"value": 20,
|
|
2940
|
-
"unit": "px"
|
|
2941
|
-
}
|
|
2942
|
-
},
|
|
2943
|
-
"6": {
|
|
2944
|
-
"$type": "dimension",
|
|
2945
|
-
"$value": {
|
|
2946
|
-
"value": 24,
|
|
2947
|
-
"unit": "px"
|
|
2948
|
-
}
|
|
2949
|
-
},
|
|
2950
|
-
"7": {
|
|
2951
|
-
"$type": "dimension",
|
|
2952
|
-
"$value": {
|
|
2953
|
-
"value": 28,
|
|
2954
|
-
"unit": "px"
|
|
2955
|
-
}
|
|
2956
|
-
},
|
|
2957
|
-
"8": {
|
|
2958
|
-
"$type": "dimension",
|
|
2959
|
-
"$value": {
|
|
2960
|
-
"value": 32,
|
|
2961
|
-
"unit": "px"
|
|
2962
|
-
}
|
|
2963
|
-
},
|
|
2964
|
-
"9": {
|
|
2965
|
-
"$type": "dimension",
|
|
2966
|
-
"$value": {
|
|
2967
|
-
"value": 36,
|
|
2968
|
-
"unit": "px"
|
|
2969
|
-
}
|
|
2970
|
-
},
|
|
2971
|
-
"10": {
|
|
2972
|
-
"$type": "dimension",
|
|
2973
|
-
"$value": {
|
|
2974
|
-
"value": 40,
|
|
2975
|
-
"unit": "px"
|
|
2976
|
-
}
|
|
2977
|
-
},
|
|
2978
|
-
"11": {
|
|
2979
|
-
"$type": "dimension",
|
|
2980
|
-
"$value": {
|
|
2981
|
-
"value": 44,
|
|
2982
|
-
"unit": "px"
|
|
2983
|
-
}
|
|
2984
|
-
},
|
|
2985
|
-
"12": {
|
|
2986
|
-
"$type": "dimension",
|
|
2987
|
-
"$value": {
|
|
2988
|
-
"value": 48,
|
|
2989
|
-
"unit": "px"
|
|
2990
|
-
}
|
|
2991
|
-
},
|
|
2992
|
-
"14": {
|
|
2993
|
-
"$type": "dimension",
|
|
2994
|
-
"$value": {
|
|
2995
|
-
"value": 56,
|
|
2996
|
-
"unit": "px"
|
|
2997
|
-
}
|
|
2998
|
-
},
|
|
2999
|
-
"16": {
|
|
3000
|
-
"$type": "dimension",
|
|
3001
|
-
"$value": {
|
|
3002
|
-
"value": 64,
|
|
3003
|
-
"unit": "px"
|
|
3004
|
-
}
|
|
3005
|
-
},
|
|
3006
|
-
"20": {
|
|
3007
|
-
"$type": "dimension",
|
|
3008
|
-
"$value": {
|
|
3009
|
-
"value": 80,
|
|
3010
|
-
"unit": "px"
|
|
3011
|
-
}
|
|
3012
|
-
},
|
|
3013
|
-
"24": {
|
|
3014
|
-
"$type": "dimension",
|
|
3015
|
-
"$value": {
|
|
3016
|
-
"value": 96,
|
|
3017
|
-
"unit": "px"
|
|
3018
|
-
}
|
|
3019
|
-
},
|
|
3020
|
-
"28": {
|
|
3021
|
-
"$type": "dimension",
|
|
3022
|
-
"$value": {
|
|
3023
|
-
"value": 112,
|
|
3024
|
-
"unit": "px"
|
|
3025
|
-
}
|
|
3026
|
-
},
|
|
3027
|
-
"32": {
|
|
3028
|
-
"$type": "dimension",
|
|
3029
|
-
"$value": {
|
|
3030
|
-
"value": 128,
|
|
3031
|
-
"unit": "px"
|
|
3032
|
-
}
|
|
3033
|
-
},
|
|
3034
|
-
"36": {
|
|
3035
|
-
"$type": "dimension",
|
|
3036
|
-
"$value": {
|
|
3037
|
-
"value": 144,
|
|
3038
|
-
"unit": "px"
|
|
3039
|
-
}
|
|
3040
|
-
},
|
|
3041
|
-
"40": {
|
|
3042
|
-
"$type": "dimension",
|
|
3043
|
-
"$value": {
|
|
3044
|
-
"value": 160,
|
|
3045
|
-
"unit": "px"
|
|
3046
|
-
}
|
|
3047
|
-
},
|
|
3048
|
-
"44": {
|
|
3049
|
-
"$type": "dimension",
|
|
3050
|
-
"$value": {
|
|
3051
|
-
"value": 176,
|
|
3052
|
-
"unit": "px"
|
|
3053
|
-
}
|
|
3054
|
-
},
|
|
3055
|
-
"48": {
|
|
3056
|
-
"$type": "dimension",
|
|
3057
|
-
"$value": {
|
|
3058
|
-
"value": 192,
|
|
3059
|
-
"unit": "px"
|
|
3060
|
-
}
|
|
3061
|
-
},
|
|
3062
|
-
"52": {
|
|
3063
|
-
"$type": "dimension",
|
|
3064
|
-
"$value": {
|
|
3065
|
-
"value": 208,
|
|
3066
|
-
"unit": "px"
|
|
3067
|
-
}
|
|
3068
|
-
},
|
|
3069
|
-
"56": {
|
|
3070
|
-
"$type": "dimension",
|
|
3071
|
-
"$value": {
|
|
3072
|
-
"value": 224,
|
|
3073
|
-
"unit": "px"
|
|
3074
|
-
}
|
|
3075
|
-
},
|
|
3076
|
-
"60": {
|
|
3077
|
-
"$type": "dimension",
|
|
3078
|
-
"$value": {
|
|
3079
|
-
"value": 240,
|
|
3080
|
-
"unit": "px"
|
|
3081
|
-
}
|
|
3082
|
-
},
|
|
3083
|
-
"64": {
|
|
3084
|
-
"$type": "dimension",
|
|
3085
|
-
"$value": {
|
|
3086
|
-
"value": 256,
|
|
3087
|
-
"unit": "px"
|
|
3088
|
-
}
|
|
3089
|
-
},
|
|
3090
|
-
"72": {
|
|
3091
|
-
"$type": "dimension",
|
|
3092
|
-
"$value": {
|
|
3093
|
-
"value": 288,
|
|
3094
|
-
"unit": "px"
|
|
3095
|
-
}
|
|
3096
|
-
},
|
|
3097
|
-
"80": {
|
|
3098
|
-
"$type": "dimension",
|
|
3099
|
-
"$value": {
|
|
3100
|
-
"value": 320,
|
|
3101
|
-
"unit": "px"
|
|
3102
|
-
}
|
|
3103
|
-
},
|
|
3104
|
-
"96": {
|
|
3105
|
-
"$type": "dimension",
|
|
3106
|
-
"$value": {
|
|
3107
|
-
"value": 384,
|
|
3108
|
-
"unit": "px"
|
|
3109
|
-
}
|
|
3110
|
-
}
|
|
3111
|
-
},
|
|
3112
2900
|
"spacing": {
|
|
3113
2901
|
"0": {
|
|
3114
2902
|
"$type": "dimension",
|
|
@@ -30,4 +30,9 @@
|
|
|
30
30
|
personalization curve as the rest of the scale instead of a fixed 9999px
|
|
31
31
|
pill that ignores subtle/none/round wrap. */
|
|
32
32
|
--radius-full: calc(var(--radius-xl) * 2);
|
|
33
|
+
/* True pill: a fixed 9999px that makes any box a circle or capsule at any size
|
|
34
|
+
and on every radius axis value. Use it where a component promises a circle
|
|
35
|
+
or pill (round buttons, avatars, switches, radios, dots); use --radius-full
|
|
36
|
+
for a large corner that follows the radius axis. */
|
|
37
|
+
--radius-pill: 9999px;
|
|
33
38
|
}
|
|
@@ -95,6 +95,14 @@
|
|
|
95
95
|
"io.atom63.derive": "calc({radius.xl} * 2)"
|
|
96
96
|
},
|
|
97
97
|
"$description": "Soft “full” = 2× md (already includes the multiplier). Stays on the same\npersonalization curve as the rest of the scale instead of a fixed 9999px\npill that ignores subtle/none/round wrap."
|
|
98
|
+
},
|
|
99
|
+
"pill": {
|
|
100
|
+
"$type": "dimension",
|
|
101
|
+
"$value": {
|
|
102
|
+
"value": 9999,
|
|
103
|
+
"unit": "px"
|
|
104
|
+
},
|
|
105
|
+
"$description": "True pill: a fixed 9999px that makes any box a circle or capsule at any size\nand on every radius axis value. Use it where a component promises a circle\nor pill (round buttons, avatars, switches, radios, dots); use --radius-full\nfor a large corner that follows the radius axis."
|
|
98
106
|
}
|
|
99
107
|
}
|
|
100
108
|
}
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
@import './typography.native.css';
|
|
17
17
|
|
|
18
18
|
:root {
|
|
19
|
+
--typography-2xs-font-size: calc(11px * var(--typography-scale, 1));
|
|
20
|
+
--typography-2xs-line-height: calc(13px * var(--typography-scale, 1));
|
|
19
21
|
--typography-xs-font-size: calc(12px * var(--typography-scale, 1));
|
|
20
22
|
--typography-xs-line-height: calc(18px * var(--typography-scale, 1));
|
|
21
23
|
--typography-sm-font-size: calc(13px * var(--typography-scale, 1));
|
|
@@ -42,6 +44,10 @@
|
|
|
42
44
|
--typography-8xl-line-height: calc(44px * var(--typography-scale, 1));
|
|
43
45
|
--typography-9xl-font-size: calc(39px * var(--typography-scale, 1));
|
|
44
46
|
--typography-9xl-line-height: calc(49px * var(--typography-scale, 1));
|
|
47
|
+
--typography-10xl-font-size: calc(40px * var(--typography-scale, 1));
|
|
48
|
+
--typography-10xl-line-height: calc(44px * var(--typography-scale, 1));
|
|
49
|
+
--typography-11xl-font-size: calc(56px * var(--typography-scale, 1));
|
|
50
|
+
--typography-11xl-line-height: calc(60px * var(--typography-scale, 1));
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
@media (min-width: 40rem) {
|
|
@@ -91,6 +97,8 @@
|
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
[data-window-size='xs'] {
|
|
100
|
+
--typography-2xs-font-size: calc(11px * var(--typography-scale, 1));
|
|
101
|
+
--typography-2xs-line-height: calc(13px * var(--typography-scale, 1));
|
|
94
102
|
--typography-xs-font-size: calc(12px * var(--typography-scale, 1));
|
|
95
103
|
--typography-xs-line-height: calc(18px * var(--typography-scale, 1));
|
|
96
104
|
--typography-sm-font-size: calc(13px * var(--typography-scale, 1));
|
|
@@ -117,9 +125,15 @@
|
|
|
117
125
|
--typography-8xl-line-height: calc(44px * var(--typography-scale, 1));
|
|
118
126
|
--typography-9xl-font-size: calc(39px * var(--typography-scale, 1));
|
|
119
127
|
--typography-9xl-line-height: calc(49px * var(--typography-scale, 1));
|
|
128
|
+
--typography-10xl-font-size: calc(40px * var(--typography-scale, 1));
|
|
129
|
+
--typography-10xl-line-height: calc(44px * var(--typography-scale, 1));
|
|
130
|
+
--typography-11xl-font-size: calc(56px * var(--typography-scale, 1));
|
|
131
|
+
--typography-11xl-line-height: calc(60px * var(--typography-scale, 1));
|
|
120
132
|
}
|
|
121
133
|
|
|
122
134
|
[data-window-size='sm'] {
|
|
135
|
+
--typography-2xs-font-size: calc(11px * var(--typography-scale, 1));
|
|
136
|
+
--typography-2xs-line-height: calc(13px * var(--typography-scale, 1));
|
|
123
137
|
--typography-xs-font-size: calc(12px * var(--typography-scale, 1));
|
|
124
138
|
--typography-xs-line-height: calc(18px * var(--typography-scale, 1));
|
|
125
139
|
--typography-sm-font-size: calc(13px * var(--typography-scale, 1));
|
|
@@ -146,11 +160,17 @@
|
|
|
146
160
|
--typography-8xl-line-height: calc(49px * var(--typography-scale, 1));
|
|
147
161
|
--typography-9xl-font-size: calc(44px * var(--typography-scale, 1));
|
|
148
162
|
--typography-9xl-line-height: calc(55px * var(--typography-scale, 1));
|
|
163
|
+
--typography-10xl-font-size: calc(40px * var(--typography-scale, 1));
|
|
164
|
+
--typography-10xl-line-height: calc(44px * var(--typography-scale, 1));
|
|
165
|
+
--typography-11xl-font-size: calc(56px * var(--typography-scale, 1));
|
|
166
|
+
--typography-11xl-line-height: calc(60px * var(--typography-scale, 1));
|
|
149
167
|
}
|
|
150
168
|
|
|
151
169
|
[data-window-size='md'],
|
|
152
170
|
[data-window-size='lg'],
|
|
153
171
|
[data-window-size='xl'] {
|
|
172
|
+
--typography-2xs-font-size: calc(11px * var(--typography-scale, 1));
|
|
173
|
+
--typography-2xs-line-height: calc(13px * var(--typography-scale, 1));
|
|
154
174
|
--typography-xs-font-size: calc(12px * var(--typography-scale, 1));
|
|
155
175
|
--typography-xs-line-height: calc(18px * var(--typography-scale, 1));
|
|
156
176
|
--typography-sm-font-size: calc(13px * var(--typography-scale, 1));
|
|
@@ -177,6 +197,10 @@
|
|
|
177
197
|
--typography-8xl-line-height: calc(54px * var(--typography-scale, 1));
|
|
178
198
|
--typography-9xl-font-size: calc(49px * var(--typography-scale, 1));
|
|
179
199
|
--typography-9xl-line-height: calc(61px * var(--typography-scale, 1));
|
|
200
|
+
--typography-10xl-font-size: calc(40px * var(--typography-scale, 1));
|
|
201
|
+
--typography-10xl-line-height: calc(44px * var(--typography-scale, 1));
|
|
202
|
+
--typography-11xl-font-size: calc(56px * var(--typography-scale, 1));
|
|
203
|
+
--typography-11xl-line-height: calc(60px * var(--typography-scale, 1));
|
|
180
204
|
}
|
|
181
205
|
|
|
182
206
|
@layer base {
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Element styles that belong with the type scale but are not tokens: <small>
|
|
3
|
-
* uses the xs step
|
|
4
|
-
* scale itself; see
|
|
3
|
+
* uses the xs step, and text without a size class takes the body role. Kept
|
|
4
|
+
* next to typography.resolver.json, which generates the scale itself; see
|
|
5
|
+
* docs/design-system/token-single-source.md.
|
|
5
6
|
*/
|
|
6
7
|
@layer base {
|
|
7
8
|
small {
|
|
8
9
|
font-size: var(--typography-xs-font-size);
|
|
9
10
|
line-height: var(--typography-xs-line-height);
|
|
10
11
|
}
|
|
12
|
+
|
|
13
|
+
/* The body role (15/23 on the web, 17/22 on a phone), instead of the browser's
|
|
14
|
+
16px and a 1.5 line height. Set on body, not html, so 1rem stays 16px. A phone
|
|
15
|
+
scope redeclares the role, so it sets the size again for the text inside it. */
|
|
16
|
+
body,
|
|
17
|
+
[data-a63-form-factor] {
|
|
18
|
+
font-size: var(--a63-type-body-font-size);
|
|
19
|
+
line-height: var(--a63-type-body-line-height);
|
|
20
|
+
}
|
|
11
21
|
}
|