@atom63/styles 0.1.0-beta.7 → 0.1.0-beta.9
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 +6 -3
- package/generated/atom63.figma-sync.json +5506 -3844
- package/generated/atom63.tokens.json +7536 -4284
- package/package.json +6 -6
- package/src/compat/a63-from-shadcn.css +265 -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/skeleton.css +7 -2
- package/src/contracts/skeleton.resolver.json +21 -30
- package/src/contracts/surface.css +4 -0
- package/src/contracts/surface.tokens.json +57 -0
- package/src/contracts/toggle.css +18 -3
- package/src/contracts/toggle.resolver.json +123 -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 +13 -0
- package/src/themes/terminal.resolver.json +62 -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 +92 -18
- 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 +120 -6
- package/src/tokens/semantics.resolver.json +301 -12
- package/src/tokens/surface.css +8 -0
- package/src/tokens/surface.resolver.json +49 -0
- package/src/tokens/type-roles.css +75 -0
- package/src/tokens/type-roles.resolver.json +366 -0
- package/src/contracts/toggle.tokens.json +0 -49
|
@@ -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
|
}
|
|
@@ -6,6 +6,30 @@
|
|
|
6
6
|
"sources": [
|
|
7
7
|
{
|
|
8
8
|
"typography": {
|
|
9
|
+
"2xs": {
|
|
10
|
+
"font": {
|
|
11
|
+
"size": {
|
|
12
|
+
"$value": {
|
|
13
|
+
"value": 11,
|
|
14
|
+
"unit": "px"
|
|
15
|
+
},
|
|
16
|
+
"$extensions": {
|
|
17
|
+
"io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"line": {
|
|
22
|
+
"height": {
|
|
23
|
+
"$value": {
|
|
24
|
+
"value": 13,
|
|
25
|
+
"unit": "px"
|
|
26
|
+
},
|
|
27
|
+
"$extensions": {
|
|
28
|
+
"io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
9
33
|
"xs": {
|
|
10
34
|
"font": {
|
|
11
35
|
"size": {
|
|
@@ -317,6 +341,54 @@
|
|
|
317
341
|
}
|
|
318
342
|
}
|
|
319
343
|
}
|
|
344
|
+
},
|
|
345
|
+
"10xl": {
|
|
346
|
+
"font": {
|
|
347
|
+
"size": {
|
|
348
|
+
"$value": {
|
|
349
|
+
"value": 40,
|
|
350
|
+
"unit": "px"
|
|
351
|
+
},
|
|
352
|
+
"$extensions": {
|
|
353
|
+
"io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
"line": {
|
|
358
|
+
"height": {
|
|
359
|
+
"$value": {
|
|
360
|
+
"value": 44,
|
|
361
|
+
"unit": "px"
|
|
362
|
+
},
|
|
363
|
+
"$extensions": {
|
|
364
|
+
"io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"11xl": {
|
|
370
|
+
"font": {
|
|
371
|
+
"size": {
|
|
372
|
+
"$value": {
|
|
373
|
+
"value": 56,
|
|
374
|
+
"unit": "px"
|
|
375
|
+
},
|
|
376
|
+
"$extensions": {
|
|
377
|
+
"io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
"line": {
|
|
382
|
+
"height": {
|
|
383
|
+
"$value": {
|
|
384
|
+
"value": 60,
|
|
385
|
+
"unit": "px"
|
|
386
|
+
},
|
|
387
|
+
"$extensions": {
|
|
388
|
+
"io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
320
392
|
}
|
|
321
393
|
},
|
|
322
394
|
"$type": "dimension"
|
package/src/tokens/index.css
CHANGED
|
@@ -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)'
|