@atom63/styles 0.1.0-beta.1 → 0.1.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +22 -13
- package/generated/atom63.figma-sync.json +23277 -0
- package/generated/atom63.tokens.json +19650 -8403
- package/generated/z-layers.d.ts +33 -0
- package/generated/z-layers.js +31 -0
- package/package.json +29 -15
- package/src/compat/a63-from-shadcn.css +281 -0
- package/src/compat/shadcn.browser.test.ts +23 -0
- package/src/compat/shadcn.css +133 -17
- package/src/contracts/action.css +4 -3
- package/src/contracts/action.native.css +11 -0
- package/src/contracts/action.tokens.json +66 -0
- package/src/contracts/badge.css +128 -58
- package/src/contracts/badge.resolver.json +454 -0
- package/src/contracts/choice.css +5 -2
- package/src/contracts/choice.native.css +9 -0
- package/src/contracts/choice.tokens.json +66 -0
- package/src/contracts/control.css +54 -57
- package/src/contracts/control.native.css +13 -0
- package/src/contracts/control.tokens.json +294 -0
- package/src/contracts/environment.css +178 -60
- package/src/contracts/environment.native.css +23 -0
- package/src/contracts/environment.resolver.json +1210 -0
- package/src/contracts/field.css +4 -2
- package/src/contracts/field.tokens.json +40 -0
- package/src/contracts/marker.css +6 -4
- package/src/contracts/marker.tokens.json +15 -0
- package/src/contracts/menu.css +25 -61
- package/src/contracts/menu.native.css +10 -0
- package/src/contracts/menu.resolver.json +122 -0
- package/src/contracts/overlay.css +11 -13
- package/src/contracts/overlay.native.css +13 -0
- package/src/contracts/overlay.tokens.json +103 -0
- package/src/contracts/segment.css +22 -68
- package/src/contracts/segment.tokens.json +19 -0
- package/src/contracts/selection.css +5 -1
- package/src/contracts/selection.tokens.json +42 -0
- package/src/contracts/skeleton.css +18 -2
- package/src/contracts/skeleton.resolver.json +62 -0
- package/src/contracts/surface.css +17 -24
- package/src/contracts/surface.native.css +17 -0
- package/src/contracts/surface.tokens.json +154 -0
- package/src/contracts/toggle.css +27 -3
- package/src/contracts/toggle.resolver.json +129 -0
- package/src/contracts/track.css +3 -1
- package/src/contracts/track.tokens.json +39 -0
- package/src/contracts/trigger.css +5 -2
- package/src/contracts/trigger.native.css +9 -0
- package/src/contracts/trigger.tokens.json +58 -0
- package/src/contracts/widget.css +76 -51
- package/src/contracts/widget.native.css +23 -0
- package/src/contracts/widget.resolver.json +1110 -0
- package/src/tailwind/roles.json +189 -0
- package/src/tailwind/theme.css +216 -24
- package/src/tailwind/utilities.css +17 -0
- package/src/themes/aqua.css +126 -89
- package/src/themes/aqua.native.css +80 -0
- package/src/themes/aqua.resolver.json +1304 -0
- package/src/themes/modern.css +10 -14
- package/src/themes/modern.native.css +16 -0
- package/src/themes/modern.resolver.json +350 -0
- package/src/themes/retro.css +22 -26
- package/src/themes/retro.native.css +16 -0
- package/src/themes/retro.resolver.json +794 -0
- package/src/themes/terminal.css +164 -41
- package/src/themes/terminal.native.css +22 -0
- package/src/themes/terminal.resolver.json +585 -0
- package/src/tokens/brand-action.css +65 -0
- package/src/tokens/brand-action.resolver.json +155 -0
- package/src/tokens/brand-ramp.css +108 -0
- package/src/tokens/brand-ramp.resolver.json +418 -0
- package/src/tokens/brand.css +6 -146
- package/src/tokens/chart-palette.browser.test.ts +188 -0
- package/src/tokens/color-mix-space.browser.test.ts +101 -0
- package/src/tokens/contrast.browser.test.ts +303 -5
- package/src/tokens/density.browser.test.ts +167 -0
- package/src/tokens/figma-parity.browser.test.ts +270 -0
- package/src/tokens/font.css +12 -0
- package/src/tokens/font.resolver.json +128 -0
- package/src/tokens/form-factor.browser.test.ts +129 -0
- package/src/tokens/foundation/effects.css +13 -13
- package/src/tokens/foundation/effects.resolver.json +433 -0
- package/src/tokens/foundation/fonts.css +11 -5
- package/src/tokens/foundation/fonts.tokens.json +45 -0
- package/src/tokens/foundation/motion.css +3 -0
- package/src/tokens/foundation/motion.tokens.json +53 -0
- package/src/tokens/foundation/palette.css +3 -0
- package/src/tokens/foundation/palette.tokens.json +1743 -0
- package/src/tokens/foundation/primitives.css +20 -43
- package/src/tokens/foundation/primitives.tokens.json +3258 -0
- package/src/tokens/foundation/radius.css +11 -9
- package/src/tokens/foundation/radius.tokens.json +108 -0
- package/src/tokens/foundation/typography.css +49 -12
- package/src/tokens/foundation/typography.native.css +21 -0
- package/src/tokens/foundation/typography.resolver.json +1008 -0
- package/src/tokens/foundation.css +0 -1
- package/src/tokens/index.css +1 -0
- package/src/tokens/motion.css +3 -1
- package/src/tokens/motion.resolver.json +135 -0
- package/src/tokens/native-values.json +38 -0
- package/src/tokens/personalization-axes.browser.test.ts +18 -3
- package/src/tokens/plate-scope.browser.test.ts +73 -0
- package/src/tokens/radius.css +12 -8
- package/src/tokens/radius.resolver.json +138 -0
- package/src/tokens/semantics.css +716 -41
- package/src/tokens/semantics.resolver.json +1639 -0
- package/src/tokens/space.css +8 -6
- package/src/tokens/space.tokens.json +78 -0
- package/src/tokens/surface.css +13 -19
- package/src/tokens/surface.resolver.json +706 -0
- package/src/tokens/swift-parity.browser.test.ts +141 -0
- package/src/tokens/type-roles.css +88 -0
- package/src/tokens/type-roles.resolver.json +419 -0
- package/src/tokens/type-scale.css +6 -0
- package/src/tokens/type-scale.resolver.json +67 -0
- package/generated/atom63.figma-tokens.json +0 -21664
- package/src/tokens/foundation/aliases.css +0 -28
- package/src/z-layers.ts +0 -40
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it } from 'vitest'
|
|
2
|
+
import swiftTokens from '../../../ui-ios/Sources/Atom63UI/Generated/Atom63Tokens.generated.swift?raw'
|
|
3
|
+
// @ts-expect-error -- plain ESM module shared with the Swift generator, no types
|
|
4
|
+
import {
|
|
5
|
+
brands,
|
|
6
|
+
createResolver,
|
|
7
|
+
skins,
|
|
8
|
+
surfaces,
|
|
9
|
+
} from '../../../ui-ios/Scripts/lib/theme-graph.mjs'
|
|
10
|
+
import computedValues from '../../generated/atom63.computed-values.json'
|
|
11
|
+
import figmaModel from '../../generated/atom63.figma-sync.json'
|
|
12
|
+
import { resetRoot, root } from '../test/apply-styles'
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* Web/iOS parity: every color in the generated Swift tokens must equal what the
|
|
16
|
+
* browser paints for its token, in light and dark mode, with the defaults an
|
|
17
|
+
* app starts with (modern theme, brand b1, surface n1). The Swift generator
|
|
18
|
+
* reads the Figma sync model; this test checks that model against the real CSS
|
|
19
|
+
* cascade, so a drift in either shows up here.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
interface Rgba {
|
|
23
|
+
r: number
|
|
24
|
+
g: number
|
|
25
|
+
b: number
|
|
26
|
+
a: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const colorPattern =
|
|
30
|
+
/\/\/\/ (--[\w-]+)\n\s+public static let (\w+) = AtomDynamicColor\(light: AtomColorComponents\(red: ([\d.]+), green: ([\d.]+), blue: ([\d.]+), opacity: ([\d.]+)\), dark: AtomColorComponents\(red: ([\d.]+), green: ([\d.]+), blue: ([\d.]+), opacity: ([\d.]+)\)\)/g
|
|
31
|
+
|
|
32
|
+
const swiftColors = [...swiftTokens.matchAll(colorPattern)].map(match => {
|
|
33
|
+
const [, token, name, ...channels] = match
|
|
34
|
+
const n = channels.map(Number)
|
|
35
|
+
return {
|
|
36
|
+
token,
|
|
37
|
+
name,
|
|
38
|
+
light: { r: n[0] * 255, g: n[1] * 255, b: n[2] * 255, a: n[3] },
|
|
39
|
+
dark: { r: n[4] * 255, g: n[5] * 255, b: n[6] * 255, a: n[7] },
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
/** Paints the token on one pixel and reads it back as sRGB. */
|
|
44
|
+
function paint(token: string): Rgba {
|
|
45
|
+
const probe = document.createElement('div')
|
|
46
|
+
probe.style.color = `var(${token})`
|
|
47
|
+
document.body.append(probe)
|
|
48
|
+
const color = getComputedStyle(probe).color
|
|
49
|
+
probe.remove()
|
|
50
|
+
const canvas = document.createElement('canvas')
|
|
51
|
+
canvas.width = 1
|
|
52
|
+
canvas.height = 1
|
|
53
|
+
const context = canvas.getContext('2d', { colorSpace: 'srgb' })!
|
|
54
|
+
context.fillStyle = color
|
|
55
|
+
context.fillRect(0, 0, 1, 1)
|
|
56
|
+
const [r, g, b, a] = context.getImageData(0, 0, 1, 1).data
|
|
57
|
+
return { r, g, b, a: a / 255 }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function setMode(mode: 'light' | 'dark') {
|
|
61
|
+
root().setAttribute('data-a63-design-language', 'ios')
|
|
62
|
+
// Atom63Theme always sets a theme, modern by default; the static Swift colors
|
|
63
|
+
// resolve that selection, and some contracts (the widget face) differ from
|
|
64
|
+
// the theme-less :root under it.
|
|
65
|
+
root().setAttribute('data-a63-theme', 'modern')
|
|
66
|
+
root().setAttribute('data-a63-mode', mode)
|
|
67
|
+
root().classList.remove('light', 'dark')
|
|
68
|
+
root().classList.add(mode)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
afterEach(() => {
|
|
72
|
+
resetRoot()
|
|
73
|
+
for (const attribute of ['data-a63-mode', 'data-a63-theme', 'data-a63-surface'])
|
|
74
|
+
root().removeAttribute(attribute)
|
|
75
|
+
root().classList.remove('light', 'dark')
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
describe('web/iOS color parity', () => {
|
|
79
|
+
it('reads the Swift colors', () => {
|
|
80
|
+
expect(swiftColors.length).toBeGreaterThan(20)
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it('matches every Swift color to the browser value in light and dark mode', () => {
|
|
84
|
+
const failures: string[] = []
|
|
85
|
+
for (const mode of ['light', 'dark'] as const) {
|
|
86
|
+
setMode(mode)
|
|
87
|
+
for (const color of swiftColors) {
|
|
88
|
+
const web = paint(color.token)
|
|
89
|
+
const swift = color[mode]
|
|
90
|
+
// One 8-bit step for rounding; alpha is premultiplied by the canvas read.
|
|
91
|
+
const drift = Math.max(
|
|
92
|
+
Math.abs(web.r - swift.r),
|
|
93
|
+
Math.abs(web.g - swift.g),
|
|
94
|
+
Math.abs(web.b - swift.b),
|
|
95
|
+
Math.abs(web.a - swift.a) * 255
|
|
96
|
+
)
|
|
97
|
+
if (drift > 1.5) {
|
|
98
|
+
failures.push(
|
|
99
|
+
`${mode} ${color.name} (${color.token}): web rgba(${web.r}, ${web.g}, ${web.b}, ${web.a.toFixed(2)}), ` +
|
|
100
|
+
`swift rgba(${swift.r.toFixed(1)}, ${swift.g.toFixed(1)}, ${swift.b.toFixed(1)}, ${swift.a})`
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
expect(failures, failures.join('\n')).toEqual([])
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
/*
|
|
109
|
+
* AtomTheme(skin:brand:surface:) resolves through the token graph the Swift
|
|
110
|
+
* generator emits, with the same algorithm as Scripts/lib/theme-graph.mjs (the
|
|
111
|
+
* Swift tests check the port against that module). Here the module's result is
|
|
112
|
+
* checked against the browser for every skin, brand, surface and mode.
|
|
113
|
+
*/
|
|
114
|
+
it('matches every color the Swift theme resolves, for every skin × brand × surface × mode', () => {
|
|
115
|
+
const resolver = createResolver(figmaModel, computedValues)
|
|
116
|
+
const failures: string[] = []
|
|
117
|
+
for (const skin of skins as string[])
|
|
118
|
+
for (const brand of brands as string[])
|
|
119
|
+
for (const surface of surfaces as string[])
|
|
120
|
+
for (const mode of ['light', 'dark'] as const) {
|
|
121
|
+
setMode(mode)
|
|
122
|
+
root().setAttribute('data-a63-theme', skin)
|
|
123
|
+
root().setAttribute('data-a63-brand', brand)
|
|
124
|
+
root().setAttribute('data-a63-surface', surface)
|
|
125
|
+
for (const color of swiftColors) {
|
|
126
|
+
const web = paint(color.token)
|
|
127
|
+
const graph = resolver.resolve(color.token, { skin, brand, surface, mode })
|
|
128
|
+
// Compare premultiplied, as the canvas stores it: a translucent
|
|
129
|
+
// color's channels are only exact to 1/255 after multiplying by alpha.
|
|
130
|
+
const drift = Math.max(
|
|
131
|
+
Math.abs(web.r * web.a - graph.r * 255 * graph.a),
|
|
132
|
+
Math.abs(web.g * web.a - graph.g * 255 * graph.a),
|
|
133
|
+
Math.abs(web.b * web.a - graph.b * 255 * graph.a),
|
|
134
|
+
Math.abs(web.a - graph.a) * 255
|
|
135
|
+
)
|
|
136
|
+
if (drift > 1.5) failures.push(`${skin}/${brand}/${surface}/${mode} ${color.name}`)
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
expect(failures.slice(0, 20), `${failures.length} differences`).toEqual([])
|
|
140
|
+
})
|
|
141
|
+
})
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Generated from src/tokens/type-roles.resolver.json by scripts/build-css-from-dtcg.mjs. Do not edit;
|
|
3
|
+
* change the DTCG source and run `pnpm --filter @atom63/styles generate:tokens`.
|
|
4
|
+
*
|
|
5
|
+
* Text roles, named after the Apple HIG text styles so one intent maps to every platform. Each
|
|
6
|
+
* role takes a step of the web type scale (and so follows the window size and type scale) and
|
|
7
|
+
* records its iOS text style in $extensions["io.atom63.platforms"]; on iOS the role uses that
|
|
8
|
+
* Font.TextStyle and Dynamic Type. -strong is the emphasized weight: bold for the display roles and the three
|
|
9
|
+
* largest titles, semibold for the rest. display and display-large sit above Apple's text
|
|
10
|
+
* styles (for balances, prices and hero headlines); iOS draws them at the same size, scaled with
|
|
11
|
+
* Dynamic Type like largeTitle (AtomDisplayRole, AtomAmountText). Web sizes follow web conventions (body is 15px here, 17pt on
|
|
12
|
+
* iOS); the role, not the number, is what stays the same.
|
|
13
|
+
* A phone screen ([data-a63-form-factor='phone'], which AppView layout="phone" stamps) takes the iOS
|
|
14
|
+
* sizes instead: body 17, subhead 15, footnote 13.
|
|
15
|
+
* The roles are declared on :root, on every [data-window-size] scope and on the phone scope, where the
|
|
16
|
+
* steps they read are redeclared, so a role inside an OS window or a phone screen takes its sizes.
|
|
17
|
+
*/
|
|
18
|
+
:root,
|
|
19
|
+
[data-window-size],
|
|
20
|
+
[data-a63-form-factor] {
|
|
21
|
+
/* Marketing hero headline, above display-large: fluid from the display step on phones to 72px on wide screens. Web only; iOS keeps display-large. */
|
|
22
|
+
--a63-type-display-hero-font-size: clamp(
|
|
23
|
+
var(--typography-10xl-font-size),
|
|
24
|
+
calc(1.5rem + 3.4vw),
|
|
25
|
+
calc(72px * var(--typography-scale, 1))
|
|
26
|
+
);
|
|
27
|
+
--a63-type-display-hero-line-height: calc(var(--a63-type-display-hero-font-size) * 1.05);
|
|
28
|
+
--a63-type-display-hero-font-weight: 600;
|
|
29
|
+
--a63-type-display-hero-font-weight-strong: 700;
|
|
30
|
+
--a63-type-display-hero-letter-spacing: -0.045em;
|
|
31
|
+
/* Display numbers and hero headlines: balances, prices, a score. Above Apple's text styles, so iOS draws the same size scaled like largeTitle: AtomDisplayRole.displayLarge. */
|
|
32
|
+
--a63-type-display-large-font-size: var(--typography-11xl-font-size);
|
|
33
|
+
--a63-type-display-large-line-height: var(--typography-11xl-line-height);
|
|
34
|
+
--a63-type-display-large-font-weight: 600;
|
|
35
|
+
--a63-type-display-large-font-weight-strong: 700;
|
|
36
|
+
/* Display tracking, tighter than text: about −0.04em for the sans display; a serif display (--a63-font-display) reads better near −0.025em. */
|
|
37
|
+
--a63-type-display-large-letter-spacing: -0.04em;
|
|
38
|
+
/* Display numbers and short headlines one step below display-large. iOS draws the same size scaled like largeTitle: AtomDisplayRole.display. */
|
|
39
|
+
--a63-type-display-font-size: var(--typography-10xl-font-size);
|
|
40
|
+
--a63-type-display-line-height: var(--typography-10xl-line-height);
|
|
41
|
+
--a63-type-display-font-weight: 600;
|
|
42
|
+
--a63-type-display-font-weight-strong: 700;
|
|
43
|
+
--a63-type-display-letter-spacing: -0.03em;
|
|
44
|
+
--a63-type-large-title-font-size: var(--typography-6xl-font-size);
|
|
45
|
+
--a63-type-large-title-line-height: var(--typography-6xl-line-height);
|
|
46
|
+
--a63-type-large-title-font-weight: 400;
|
|
47
|
+
--a63-type-large-title-font-weight-strong: 700;
|
|
48
|
+
--a63-type-title-1-font-size: var(--typography-5xl-font-size);
|
|
49
|
+
--a63-type-title-1-line-height: var(--typography-5xl-line-height);
|
|
50
|
+
--a63-type-title-1-font-weight: 400;
|
|
51
|
+
--a63-type-title-1-font-weight-strong: 700;
|
|
52
|
+
--a63-type-title-2-font-size: var(--typography-3xl-font-size);
|
|
53
|
+
--a63-type-title-2-line-height: var(--typography-3xl-line-height);
|
|
54
|
+
--a63-type-title-2-font-weight: 400;
|
|
55
|
+
--a63-type-title-2-font-weight-strong: 700;
|
|
56
|
+
--a63-type-title-3-font-size: var(--typography-2xl-font-size);
|
|
57
|
+
--a63-type-title-3-line-height: var(--typography-2xl-line-height);
|
|
58
|
+
--a63-type-title-3-font-weight: 400;
|
|
59
|
+
--a63-type-title-3-font-weight-strong: 600;
|
|
60
|
+
--a63-type-headline-font-size: var(--typography-base-font-size);
|
|
61
|
+
--a63-type-headline-line-height: var(--typography-base-line-height);
|
|
62
|
+
--a63-type-headline-font-weight: 600;
|
|
63
|
+
--a63-type-headline-font-weight-strong: 600;
|
|
64
|
+
--a63-type-body-font-size: var(--typography-base-font-size);
|
|
65
|
+
--a63-type-body-line-height: var(--typography-base-line-height);
|
|
66
|
+
--a63-type-body-font-weight: 400;
|
|
67
|
+
--a63-type-body-font-weight-strong: 600;
|
|
68
|
+
--a63-type-callout-font-size: var(--typography-base-font-size);
|
|
69
|
+
--a63-type-callout-line-height: var(--typography-base-line-height);
|
|
70
|
+
--a63-type-callout-font-weight: 400;
|
|
71
|
+
--a63-type-callout-font-weight-strong: 600;
|
|
72
|
+
--a63-type-subhead-font-size: var(--typography-sm-font-size);
|
|
73
|
+
--a63-type-subhead-line-height: var(--typography-sm-line-height);
|
|
74
|
+
--a63-type-subhead-font-weight: 400;
|
|
75
|
+
--a63-type-subhead-font-weight-strong: 600;
|
|
76
|
+
--a63-type-footnote-font-size: var(--typography-xs-font-size);
|
|
77
|
+
--a63-type-footnote-line-height: var(--typography-xs-line-height);
|
|
78
|
+
--a63-type-footnote-font-weight: 400;
|
|
79
|
+
--a63-type-footnote-font-weight-strong: 600;
|
|
80
|
+
--a63-type-caption-1-font-size: var(--typography-xs-font-size);
|
|
81
|
+
--a63-type-caption-1-line-height: var(--typography-xs-line-height);
|
|
82
|
+
--a63-type-caption-1-font-weight: 400;
|
|
83
|
+
--a63-type-caption-1-font-weight-strong: 600;
|
|
84
|
+
--a63-type-caption-2-font-size: var(--typography-2xs-font-size);
|
|
85
|
+
--a63-type-caption-2-line-height: var(--typography-2xs-line-height);
|
|
86
|
+
--a63-type-caption-2-font-weight: 400;
|
|
87
|
+
--a63-type-caption-2-font-weight-strong: 600;
|
|
88
|
+
}
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2025.10",
|
|
3
|
+
"description": "Text roles, named after the Apple HIG text styles so one intent maps to every platform. Each\nrole takes a step of the web type scale (and so follows the window size and type scale) and\nrecords its iOS text style in $extensions[\"io.atom63.platforms\"]; on iOS the role uses that\nFont.TextStyle and Dynamic Type. -strong is the emphasized weight: bold for the display roles and the three\nlargest titles, semibold for the rest. display and display-large sit above Apple's text\nstyles (for balances, prices and hero headlines); iOS draws them at the same size, scaled with\nDynamic Type like largeTitle (AtomDisplayRole, AtomAmountText). Web sizes follow web conventions (body is 15px here, 17pt on\niOS); the role, not the number, is what stays the same.\nA phone screen ([data-a63-form-factor='phone'], which AppView layout=\"phone\" stamps) takes the iOS\nsizes instead: body 17, subhead 15, footnote 13.\nThe roles are declared on :root, on every [data-window-size] scope and on the phone scope, where the\nsteps they read are redeclared, so a role inside an OS window or a phone screen takes its sizes.",
|
|
4
|
+
"sets": {
|
|
5
|
+
"base": {
|
|
6
|
+
"sources": [
|
|
7
|
+
{
|
|
8
|
+
"a63": {
|
|
9
|
+
"type": {
|
|
10
|
+
"display-hero": {
|
|
11
|
+
"font-size": {
|
|
12
|
+
"$type": "dimension",
|
|
13
|
+
"$value": {
|
|
14
|
+
"value": 72,
|
|
15
|
+
"unit": "px"
|
|
16
|
+
},
|
|
17
|
+
"$description": "Marketing hero headline, above display-large: fluid from the display step on phones to 72px on wide screens. Web only; iOS keeps display-large.",
|
|
18
|
+
"$extensions": {
|
|
19
|
+
"io.atom63.derive": "clamp({typography.10xl.font.size}, calc(1.5rem + 3.4vw), calc({$value} * var(--typography-scale, 1)))"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"line-height": {
|
|
23
|
+
"$type": "dimension",
|
|
24
|
+
"$value": {
|
|
25
|
+
"value": 76,
|
|
26
|
+
"unit": "px"
|
|
27
|
+
},
|
|
28
|
+
"$extensions": {
|
|
29
|
+
"io.atom63.derive": "calc({a63.type.display-hero.font-size} * 1.05)"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"font-weight": {
|
|
33
|
+
"$type": "fontWeight",
|
|
34
|
+
"$value": 600
|
|
35
|
+
},
|
|
36
|
+
"font-weight-strong": {
|
|
37
|
+
"$type": "fontWeight",
|
|
38
|
+
"$value": 700
|
|
39
|
+
},
|
|
40
|
+
"letter-spacing": {
|
|
41
|
+
"$type": "dimension",
|
|
42
|
+
"$value": {
|
|
43
|
+
"value": -0.045,
|
|
44
|
+
"unit": "em"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"display-large": {
|
|
49
|
+
"font-size": {
|
|
50
|
+
"$type": "dimension",
|
|
51
|
+
"$value": "{typography.11xl.font.size}",
|
|
52
|
+
"$description": "Display numbers and hero headlines: balances, prices, a score. Above Apple's text styles, so iOS draws the same size scaled like largeTitle: AtomDisplayRole.displayLarge.",
|
|
53
|
+
"$extensions": {
|
|
54
|
+
"io.atom63.platforms": {
|
|
55
|
+
"ios": {
|
|
56
|
+
"textStyle": "largeTitle",
|
|
57
|
+
"dynamicType": "system"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"line-height": {
|
|
63
|
+
"$type": "dimension",
|
|
64
|
+
"$value": "{typography.11xl.line.height}"
|
|
65
|
+
},
|
|
66
|
+
"font-weight": {
|
|
67
|
+
"$type": "fontWeight",
|
|
68
|
+
"$value": 600
|
|
69
|
+
},
|
|
70
|
+
"font-weight-strong": {
|
|
71
|
+
"$type": "fontWeight",
|
|
72
|
+
"$value": 700
|
|
73
|
+
},
|
|
74
|
+
"letter-spacing": {
|
|
75
|
+
"$type": "dimension",
|
|
76
|
+
"$value": {
|
|
77
|
+
"value": -0.04,
|
|
78
|
+
"unit": "em"
|
|
79
|
+
},
|
|
80
|
+
"$description": "Display tracking, tighter than text: about −0.04em for the sans display; a serif display (--a63-font-display) reads better near −0.025em."
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"display": {
|
|
84
|
+
"font-size": {
|
|
85
|
+
"$type": "dimension",
|
|
86
|
+
"$value": "{typography.10xl.font.size}",
|
|
87
|
+
"$description": "Display numbers and short headlines one step below display-large. iOS draws the same size scaled like largeTitle: AtomDisplayRole.display.",
|
|
88
|
+
"$extensions": {
|
|
89
|
+
"io.atom63.platforms": {
|
|
90
|
+
"ios": {
|
|
91
|
+
"textStyle": "largeTitle",
|
|
92
|
+
"dynamicType": "system"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"line-height": {
|
|
98
|
+
"$type": "dimension",
|
|
99
|
+
"$value": "{typography.10xl.line.height}"
|
|
100
|
+
},
|
|
101
|
+
"font-weight": {
|
|
102
|
+
"$type": "fontWeight",
|
|
103
|
+
"$value": 600
|
|
104
|
+
},
|
|
105
|
+
"font-weight-strong": {
|
|
106
|
+
"$type": "fontWeight",
|
|
107
|
+
"$value": 700
|
|
108
|
+
},
|
|
109
|
+
"letter-spacing": {
|
|
110
|
+
"$type": "dimension",
|
|
111
|
+
"$value": {
|
|
112
|
+
"value": -0.03,
|
|
113
|
+
"unit": "em"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"large-title": {
|
|
118
|
+
"font-size": {
|
|
119
|
+
"$type": "dimension",
|
|
120
|
+
"$value": "{typography.6xl.font.size}",
|
|
121
|
+
"$extensions": {
|
|
122
|
+
"io.atom63.platforms": {
|
|
123
|
+
"ios": {
|
|
124
|
+
"textStyle": "largeTitle",
|
|
125
|
+
"dynamicType": "system"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"line-height": {
|
|
131
|
+
"$type": "dimension",
|
|
132
|
+
"$value": "{typography.6xl.line.height}"
|
|
133
|
+
},
|
|
134
|
+
"font-weight": {
|
|
135
|
+
"$type": "fontWeight",
|
|
136
|
+
"$value": 400
|
|
137
|
+
},
|
|
138
|
+
"font-weight-strong": {
|
|
139
|
+
"$type": "fontWeight",
|
|
140
|
+
"$value": 700
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"title-1": {
|
|
144
|
+
"font-size": {
|
|
145
|
+
"$type": "dimension",
|
|
146
|
+
"$value": "{typography.5xl.font.size}",
|
|
147
|
+
"$extensions": {
|
|
148
|
+
"io.atom63.platforms": {
|
|
149
|
+
"ios": {
|
|
150
|
+
"textStyle": "title",
|
|
151
|
+
"dynamicType": "system"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"line-height": {
|
|
157
|
+
"$type": "dimension",
|
|
158
|
+
"$value": "{typography.5xl.line.height}"
|
|
159
|
+
},
|
|
160
|
+
"font-weight": {
|
|
161
|
+
"$type": "fontWeight",
|
|
162
|
+
"$value": 400
|
|
163
|
+
},
|
|
164
|
+
"font-weight-strong": {
|
|
165
|
+
"$type": "fontWeight",
|
|
166
|
+
"$value": 700
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"title-2": {
|
|
170
|
+
"font-size": {
|
|
171
|
+
"$type": "dimension",
|
|
172
|
+
"$value": "{typography.3xl.font.size}",
|
|
173
|
+
"$extensions": {
|
|
174
|
+
"io.atom63.platforms": {
|
|
175
|
+
"ios": {
|
|
176
|
+
"textStyle": "title2",
|
|
177
|
+
"dynamicType": "system"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"line-height": {
|
|
183
|
+
"$type": "dimension",
|
|
184
|
+
"$value": "{typography.3xl.line.height}"
|
|
185
|
+
},
|
|
186
|
+
"font-weight": {
|
|
187
|
+
"$type": "fontWeight",
|
|
188
|
+
"$value": 400
|
|
189
|
+
},
|
|
190
|
+
"font-weight-strong": {
|
|
191
|
+
"$type": "fontWeight",
|
|
192
|
+
"$value": 700
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"title-3": {
|
|
196
|
+
"font-size": {
|
|
197
|
+
"$type": "dimension",
|
|
198
|
+
"$value": "{typography.2xl.font.size}",
|
|
199
|
+
"$extensions": {
|
|
200
|
+
"io.atom63.platforms": {
|
|
201
|
+
"ios": {
|
|
202
|
+
"textStyle": "title3",
|
|
203
|
+
"dynamicType": "system"
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"line-height": {
|
|
209
|
+
"$type": "dimension",
|
|
210
|
+
"$value": "{typography.2xl.line.height}"
|
|
211
|
+
},
|
|
212
|
+
"font-weight": {
|
|
213
|
+
"$type": "fontWeight",
|
|
214
|
+
"$value": 400
|
|
215
|
+
},
|
|
216
|
+
"font-weight-strong": {
|
|
217
|
+
"$type": "fontWeight",
|
|
218
|
+
"$value": 600
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"headline": {
|
|
222
|
+
"font-size": {
|
|
223
|
+
"$type": "dimension",
|
|
224
|
+
"$value": "{typography.base.font.size}",
|
|
225
|
+
"$extensions": {
|
|
226
|
+
"io.atom63.platforms": {
|
|
227
|
+
"ios": {
|
|
228
|
+
"textStyle": "headline",
|
|
229
|
+
"dynamicType": "system"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"line-height": {
|
|
235
|
+
"$type": "dimension",
|
|
236
|
+
"$value": "{typography.base.line.height}"
|
|
237
|
+
},
|
|
238
|
+
"font-weight": {
|
|
239
|
+
"$type": "fontWeight",
|
|
240
|
+
"$value": 600
|
|
241
|
+
},
|
|
242
|
+
"font-weight-strong": {
|
|
243
|
+
"$type": "fontWeight",
|
|
244
|
+
"$value": 600
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"body": {
|
|
248
|
+
"font-size": {
|
|
249
|
+
"$type": "dimension",
|
|
250
|
+
"$value": "{typography.base.font.size}",
|
|
251
|
+
"$extensions": {
|
|
252
|
+
"io.atom63.platforms": {
|
|
253
|
+
"ios": {
|
|
254
|
+
"textStyle": "body",
|
|
255
|
+
"dynamicType": "system"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"line-height": {
|
|
261
|
+
"$type": "dimension",
|
|
262
|
+
"$value": "{typography.base.line.height}"
|
|
263
|
+
},
|
|
264
|
+
"font-weight": {
|
|
265
|
+
"$type": "fontWeight",
|
|
266
|
+
"$value": 400
|
|
267
|
+
},
|
|
268
|
+
"font-weight-strong": {
|
|
269
|
+
"$type": "fontWeight",
|
|
270
|
+
"$value": 600
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"callout": {
|
|
274
|
+
"font-size": {
|
|
275
|
+
"$type": "dimension",
|
|
276
|
+
"$value": "{typography.base.font.size}",
|
|
277
|
+
"$extensions": {
|
|
278
|
+
"io.atom63.platforms": {
|
|
279
|
+
"ios": {
|
|
280
|
+
"textStyle": "callout",
|
|
281
|
+
"dynamicType": "system"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"line-height": {
|
|
287
|
+
"$type": "dimension",
|
|
288
|
+
"$value": "{typography.base.line.height}"
|
|
289
|
+
},
|
|
290
|
+
"font-weight": {
|
|
291
|
+
"$type": "fontWeight",
|
|
292
|
+
"$value": 400
|
|
293
|
+
},
|
|
294
|
+
"font-weight-strong": {
|
|
295
|
+
"$type": "fontWeight",
|
|
296
|
+
"$value": 600
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"subhead": {
|
|
300
|
+
"font-size": {
|
|
301
|
+
"$type": "dimension",
|
|
302
|
+
"$value": "{typography.sm.font.size}",
|
|
303
|
+
"$extensions": {
|
|
304
|
+
"io.atom63.platforms": {
|
|
305
|
+
"ios": {
|
|
306
|
+
"textStyle": "subheadline",
|
|
307
|
+
"dynamicType": "system"
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"line-height": {
|
|
313
|
+
"$type": "dimension",
|
|
314
|
+
"$value": "{typography.sm.line.height}"
|
|
315
|
+
},
|
|
316
|
+
"font-weight": {
|
|
317
|
+
"$type": "fontWeight",
|
|
318
|
+
"$value": 400
|
|
319
|
+
},
|
|
320
|
+
"font-weight-strong": {
|
|
321
|
+
"$type": "fontWeight",
|
|
322
|
+
"$value": 600
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"footnote": {
|
|
326
|
+
"font-size": {
|
|
327
|
+
"$type": "dimension",
|
|
328
|
+
"$value": "{typography.xs.font.size}",
|
|
329
|
+
"$extensions": {
|
|
330
|
+
"io.atom63.platforms": {
|
|
331
|
+
"ios": {
|
|
332
|
+
"textStyle": "footnote",
|
|
333
|
+
"dynamicType": "system"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"line-height": {
|
|
339
|
+
"$type": "dimension",
|
|
340
|
+
"$value": "{typography.xs.line.height}"
|
|
341
|
+
},
|
|
342
|
+
"font-weight": {
|
|
343
|
+
"$type": "fontWeight",
|
|
344
|
+
"$value": 400
|
|
345
|
+
},
|
|
346
|
+
"font-weight-strong": {
|
|
347
|
+
"$type": "fontWeight",
|
|
348
|
+
"$value": 600
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"caption-1": {
|
|
352
|
+
"font-size": {
|
|
353
|
+
"$type": "dimension",
|
|
354
|
+
"$value": "{typography.xs.font.size}",
|
|
355
|
+
"$extensions": {
|
|
356
|
+
"io.atom63.platforms": {
|
|
357
|
+
"ios": {
|
|
358
|
+
"textStyle": "caption",
|
|
359
|
+
"dynamicType": "system"
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"line-height": {
|
|
365
|
+
"$type": "dimension",
|
|
366
|
+
"$value": "{typography.xs.line.height}"
|
|
367
|
+
},
|
|
368
|
+
"font-weight": {
|
|
369
|
+
"$type": "fontWeight",
|
|
370
|
+
"$value": 400
|
|
371
|
+
},
|
|
372
|
+
"font-weight-strong": {
|
|
373
|
+
"$type": "fontWeight",
|
|
374
|
+
"$value": 600
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
"caption-2": {
|
|
378
|
+
"font-size": {
|
|
379
|
+
"$type": "dimension",
|
|
380
|
+
"$value": "{typography.2xs.font.size}",
|
|
381
|
+
"$extensions": {
|
|
382
|
+
"io.atom63.platforms": {
|
|
383
|
+
"ios": {
|
|
384
|
+
"textStyle": "caption2",
|
|
385
|
+
"dynamicType": "system"
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"line-height": {
|
|
391
|
+
"$type": "dimension",
|
|
392
|
+
"$value": "{typography.2xs.line.height}"
|
|
393
|
+
},
|
|
394
|
+
"font-weight": {
|
|
395
|
+
"$type": "fontWeight",
|
|
396
|
+
"$value": 400
|
|
397
|
+
},
|
|
398
|
+
"font-weight-strong": {
|
|
399
|
+
"$type": "fontWeight",
|
|
400
|
+
"$value": 600
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
"$extensions": {
|
|
408
|
+
"io.atom63.css": {
|
|
409
|
+
"selector": ":root,\n[data-window-size],\n[data-a63-form-factor]"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"resolutionOrder": [
|
|
415
|
+
{
|
|
416
|
+
"$ref": "#/sets/base"
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
+
* Generated from src/tokens/type-scale.resolver.json by scripts/build-css-from-dtcg.mjs. Do not edit;
|
|
3
|
+
* change the DTCG source and run `pnpm --filter @atom63/styles generate:tokens`.
|
|
4
|
+
*
|
|
2
5
|
* Typography personalization axis.
|
|
3
6
|
*
|
|
4
7
|
* [data-a63-type-scale] sets the multiplier the responsive type scale
|
|
@@ -9,12 +12,15 @@
|
|
|
9
12
|
[data-a63-type-scale='compact'] {
|
|
10
13
|
--typography-scale: 0.9;
|
|
11
14
|
}
|
|
15
|
+
|
|
12
16
|
[data-a63-type-scale='normal'] {
|
|
13
17
|
--typography-scale: 1;
|
|
14
18
|
}
|
|
19
|
+
|
|
15
20
|
[data-a63-type-scale='comfortable'] {
|
|
16
21
|
--typography-scale: 1.1;
|
|
17
22
|
}
|
|
23
|
+
|
|
18
24
|
[data-a63-type-scale='large'] {
|
|
19
25
|
--typography-scale: 1.2;
|
|
20
26
|
}
|