@cognitap/radiant 0.0.4 → 0.0.5
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/CHANGELOG.md +27 -0
- package/README.md +9 -0
- package/dist/library/Card.d.ts.map +1 -1
- package/dist/library/Card.js +8 -6
- package/dist/library/Card.js.map +1 -1
- package/dist/library/Checkbox.js +2 -2
- package/dist/library/Checkbox.js.map +1 -1
- package/dist/library/Collapsible.d.ts.map +1 -1
- package/dist/library/Collapsible.js +5 -4
- package/dist/library/Collapsible.js.map +1 -1
- package/dist/library/Dialog.d.ts.map +1 -1
- package/dist/library/Dialog.js +8 -6
- package/dist/library/Dialog.js.map +1 -1
- package/dist/library/Field.js +4 -4
- package/dist/library/Field.js.map +1 -1
- package/dist/library/Input.d.ts.map +1 -1
- package/dist/library/Input.js +4 -3
- package/dist/library/Input.js.map +1 -1
- package/dist/library/Link.d.ts.map +1 -1
- package/dist/library/Link.js +0 -1
- package/dist/library/Link.js.map +1 -1
- package/dist/library/RadioGroup.js +2 -2
- package/dist/library/RadioGroup.js.map +1 -1
- package/dist/library/ThemeScope.js +1 -1
- package/dist/library/ThemeScope.js.map +1 -1
- package/dist/library/actionStyles.js +2 -2
- package/dist/library/actionStyles.js.map +1 -1
- package/dist/library/cn.d.ts +2 -1
- package/dist/library/cn.d.ts.map +1 -1
- package/dist/library/cn.js +22 -1
- package/dist/library/cn.js.map +1 -1
- package/dist/library/index.d.ts +3 -1
- package/dist/library/index.d.ts.map +1 -1
- package/dist/library/index.js +1 -0
- package/dist/library/index.js.map +1 -1
- package/dist/library/styles.css +1 -1
- package/dist/library/themes/defineTheme.d.ts.map +1 -1
- package/dist/library/themes/defineTheme.js +5 -1
- package/dist/library/themes/defineTheme.js.map +1 -1
- package/dist/library/themes/index.d.ts +1 -1
- package/dist/library/themes/index.d.ts.map +1 -1
- package/dist/library/themes/index.js.map +1 -1
- package/dist/library/themes/themeDocument.d.ts.map +1 -1
- package/dist/library/themes/themeDocument.js +29 -4
- package/dist/library/themes/themeDocument.js.map +1 -1
- package/dist/library/themes/themeDocumentTypes.d.ts +11 -0
- package/dist/library/themes/themeDocumentTypes.d.ts.map +1 -1
- package/dist/library/themes/themeDocumentTypes.js.map +1 -1
- package/dist/library/themes/tokens.d.ts +7 -0
- package/dist/library/themes/tokens.d.ts.map +1 -1
- package/dist/library/themes/tokens.js +99 -0
- package/dist/library/themes/tokens.js.map +1 -1
- package/dist/library/typography/index.d.ts +72 -0
- package/dist/library/typography/index.d.ts.map +1 -0
- package/dist/library/typography/index.js +160 -0
- package/dist/library/typography/index.js.map +1 -0
- package/dist/library/typography/types.d.ts +78 -0
- package/dist/library/typography/types.d.ts.map +1 -0
- package/dist/library/typography/types.js +2 -0
- package/dist/library/typography/types.js.map +1 -0
- package/docs/system.md +7 -0
- package/docs/theming.md +204 -0
- package/package.json +7 -2
- package/src/Card.tsx +8 -6
- package/src/Checkbox.tsx +2 -2
- package/src/Collapsible.tsx +5 -4
- package/src/Dialog.tsx +8 -6
- package/src/Field.tsx +4 -4
- package/src/Input.tsx +4 -3
- package/src/Link.tsx +0 -1
- package/src/RadioGroup.tsx +2 -2
- package/src/ThemeScope.tsx +1 -1
- package/src/actionStyles.ts +2 -2
- package/src/cn.ts +25 -1
- package/src/index.ts +3 -0
- package/src/styles.css +1 -0
- package/src/themes/baseline.css +131 -0
- package/src/themes/defineTheme.ts +5 -1
- package/src/themes/index.ts +1 -0
- package/src/themes/themeDocument.ts +34 -4
- package/src/themes/themeDocumentTypes.ts +12 -0
- package/src/themes/tokens.ts +137 -0
- package/src/typography/index.ts +199 -0
- package/src/typography/types.ts +92 -0
- package/src/typography.css +336 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import {
|
|
2
|
+
freezeTree,
|
|
3
|
+
typographyRoles,
|
|
4
|
+
typographyStyles,
|
|
5
|
+
typographyTokens
|
|
6
|
+
} from '../themes/tokens.js'
|
|
7
|
+
import type {
|
|
8
|
+
TypographyAssignment,
|
|
9
|
+
TypographyFont,
|
|
10
|
+
TypographyInput,
|
|
11
|
+
TypographyProfile,
|
|
12
|
+
TypographyProseRhythm,
|
|
13
|
+
TypographyResult
|
|
14
|
+
} from './types.js'
|
|
15
|
+
export type * from './types.js'
|
|
16
|
+
export { typographyRoles }
|
|
17
|
+
|
|
18
|
+
const inter = { family: 'Inter, system-ui, sans-serif', profile: 'inter' } as const
|
|
19
|
+
const serif = { family: '"Source Serif 4", Georgia, serif', profile: 'source-serif-4' } as const
|
|
20
|
+
const plex = { family: '"IBM Plex Sans", system-ui, sans-serif', profile: 'plex-sans' } as const
|
|
21
|
+
const mono = { family: '"IBM Plex Mono", ui-monospace, monospace', profile: 'plex-mono' } as const
|
|
22
|
+
export const typographyPresets = freezeTree({
|
|
23
|
+
inter: { name: 'Inter', fonts: { body: inter, headings: inter, ui: inter, code: mono } },
|
|
24
|
+
'source-serif': {
|
|
25
|
+
name: 'Source Serif 4 + Inter',
|
|
26
|
+
fonts: { body: serif, headings: serif, ui: inter, code: mono }
|
|
27
|
+
},
|
|
28
|
+
plex: {
|
|
29
|
+
name: 'Plex Sans + Plex Mono',
|
|
30
|
+
fonts: { body: plex, headings: plex, ui: plex, code: mono }
|
|
31
|
+
}
|
|
32
|
+
} as const)
|
|
33
|
+
const assignments: readonly TypographyAssignment[] = ['body', 'headings', 'ui', 'code']
|
|
34
|
+
const profiles: readonly TypographyProfile[] = [
|
|
35
|
+
'inter',
|
|
36
|
+
'source-serif-4',
|
|
37
|
+
'plex-sans',
|
|
38
|
+
'plex-mono',
|
|
39
|
+
'manual'
|
|
40
|
+
]
|
|
41
|
+
const bodyProfiles: Partial<Record<TypographyProfile, readonly [number, number, number]>> = {
|
|
42
|
+
inter: [20, 1.6, 64],
|
|
43
|
+
'source-serif-4': [21, 1.65, 62],
|
|
44
|
+
'plex-sans': [20, 1.6, 62]
|
|
45
|
+
}
|
|
46
|
+
const weights: Partial<Record<TypographyProfile, readonly [number, number]>> = {
|
|
47
|
+
inter: [100, 900],
|
|
48
|
+
'source-serif-4': [200, 900],
|
|
49
|
+
'plex-sans': [100, 700],
|
|
50
|
+
'plex-mono': [100, 700]
|
|
51
|
+
}
|
|
52
|
+
function record(value: unknown, path: string): void {
|
|
53
|
+
if (
|
|
54
|
+
!value ||
|
|
55
|
+
typeof value !== 'object' ||
|
|
56
|
+
Array.isArray(value) ||
|
|
57
|
+
![Object.prototype, null].includes(Object.getPrototypeOf(value))
|
|
58
|
+
)
|
|
59
|
+
throw new TypeError(`${path} must be a plain object.`)
|
|
60
|
+
}
|
|
61
|
+
function keys(value: object, allowed: readonly string[], path: string) {
|
|
62
|
+
for (const key of Object.keys(value))
|
|
63
|
+
if (!allowed.includes(key)) throw new TypeError(`Unknown key: ${path}.${key}.`)
|
|
64
|
+
}
|
|
65
|
+
function number(value: unknown, min: number, max: number, path: string) {
|
|
66
|
+
if (typeof value !== 'number' || !Number.isFinite(value) || value < min || value > max)
|
|
67
|
+
throw new TypeError(`${path} must be a finite number from ${min} to ${max}.`)
|
|
68
|
+
}
|
|
69
|
+
function metrics(value: object, bounds: Record<string, readonly [number, number]>, path: string) {
|
|
70
|
+
record(value, path)
|
|
71
|
+
keys(value, Object.keys(bounds), path)
|
|
72
|
+
for (const [key, item] of Object.entries(value))
|
|
73
|
+
if (item !== undefined) number(item, ...bounds[key], `${path}.${key}`)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Pure, server-safe calculations. Input omits automatic metrics; output never loads a font. */
|
|
77
|
+
export function generateTypography(input: TypographyInput = {}): TypographyResult {
|
|
78
|
+
record(input, 'typography')
|
|
79
|
+
keys(input, ['preset', 'fonts', 'prose', 'ui', 'styles'], 'typography')
|
|
80
|
+
const preset = input.preset === undefined ? 'inter' : input.preset
|
|
81
|
+
if (typeof preset !== 'string' || !Object.hasOwn(typographyPresets, preset))
|
|
82
|
+
throw new TypeError('Unknown typography.preset.')
|
|
83
|
+
const fonts = { ...typographyPresets[preset].fonts } as Record<
|
|
84
|
+
TypographyAssignment,
|
|
85
|
+
TypographyFont
|
|
86
|
+
>
|
|
87
|
+
if (input.fonts !== undefined) {
|
|
88
|
+
record(input.fonts, 'typography.fonts')
|
|
89
|
+
keys(input.fonts, assignments, 'typography.fonts')
|
|
90
|
+
for (const key of assignments) {
|
|
91
|
+
const font = input.fonts[key]
|
|
92
|
+
if (font === undefined) continue
|
|
93
|
+
record(font, `typography.fonts.${key}`)
|
|
94
|
+
keys(font, ['family', 'profile'], `typography.fonts.${key}`)
|
|
95
|
+
if (
|
|
96
|
+
typeof font.family !== 'string' ||
|
|
97
|
+
!font.family.trim() ||
|
|
98
|
+
/[;{}@]|url\s*\(/i.test(font.family) ||
|
|
99
|
+
[...font.family].some(
|
|
100
|
+
character => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127
|
|
101
|
+
)
|
|
102
|
+
)
|
|
103
|
+
throw new TypeError(`typography.fonts.${key}.family must be a CSS font-family list.`)
|
|
104
|
+
if (font.profile !== undefined && !profiles.includes(font.profile))
|
|
105
|
+
throw new TypeError(`Unknown typography.fonts.${key}.profile.`)
|
|
106
|
+
fonts[key] = { family: font.family, profile: font.profile ?? 'manual' }
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const manualProse = input.prose === undefined ? {} : input.prose,
|
|
110
|
+
manualUI = input.ui === undefined ? {} : input.ui
|
|
111
|
+
metrics(
|
|
112
|
+
manualProse,
|
|
113
|
+
{
|
|
114
|
+
size: [12, 40],
|
|
115
|
+
lineHeight: [1, 3],
|
|
116
|
+
paragraphSpacing: [0, 4],
|
|
117
|
+
measure: [20, 120],
|
|
118
|
+
headingScale: [1.1, 1.5]
|
|
119
|
+
},
|
|
120
|
+
'typography.prose'
|
|
121
|
+
)
|
|
122
|
+
metrics(manualUI, { size: [12, 32], lineHeight: [1, 3] }, 'typography.ui')
|
|
123
|
+
const profile = bodyProfiles[fonts.body.profile ?? 'manual']
|
|
124
|
+
const prose: TypographyProseRhythm = {
|
|
125
|
+
size: profile?.[0] ?? 20,
|
|
126
|
+
lineHeight: profile?.[1] ?? 1.65,
|
|
127
|
+
measure: profile?.[2] ?? 64,
|
|
128
|
+
paragraphSpacing: 1.25,
|
|
129
|
+
headingScale: 1.25,
|
|
130
|
+
...defined(manualProse)
|
|
131
|
+
}
|
|
132
|
+
const ui = { size: 16, lineHeight: 1.5, ...defined(manualUI) }
|
|
133
|
+
const styles = typographyStyles(prose, ui)
|
|
134
|
+
const overrides = input.styles === undefined ? {} : input.styles
|
|
135
|
+
record(overrides, 'typography.styles')
|
|
136
|
+
keys(overrides, typographyRoles, 'typography.styles')
|
|
137
|
+
for (const role of typographyRoles) {
|
|
138
|
+
const override = overrides[role]
|
|
139
|
+
if (override === undefined) continue
|
|
140
|
+
record(override, `typography.styles.${role}`)
|
|
141
|
+
const { assignment, ...numeric } = override
|
|
142
|
+
if (assignment !== undefined && !assignments.includes(assignment))
|
|
143
|
+
throw new TypeError(`Unknown typography.styles.${role}.assignment.`)
|
|
144
|
+
metrics(
|
|
145
|
+
numeric,
|
|
146
|
+
{
|
|
147
|
+
narrow: [8, 256],
|
|
148
|
+
wide: [8, 512],
|
|
149
|
+
weight: [1, 1000],
|
|
150
|
+
lineHeight: [0.8, 3],
|
|
151
|
+
tracking: [-0.2, 0.5],
|
|
152
|
+
measure: [0, 120]
|
|
153
|
+
},
|
|
154
|
+
`typography.styles.${role}`
|
|
155
|
+
)
|
|
156
|
+
styles[role] = { ...styles[role], ...defined(override) }
|
|
157
|
+
if (styles[role].wide < styles[role].narrow)
|
|
158
|
+
throw new TypeError(`typography.styles.${role}.wide must be at least narrow.`)
|
|
159
|
+
}
|
|
160
|
+
const warnings: TypographyResult['warnings'][number][] = []
|
|
161
|
+
for (const role of typographyRoles) {
|
|
162
|
+
const s = styles[role],
|
|
163
|
+
range = weights[fonts[s.assignment].profile ?? 'manual']
|
|
164
|
+
if (range && (s.weight < range[0] || s.weight > range[1]))
|
|
165
|
+
warnings.push({ role, requestedWeight: s.weight, supportedWeights: range })
|
|
166
|
+
}
|
|
167
|
+
return freezeTree({
|
|
168
|
+
input: {
|
|
169
|
+
preset,
|
|
170
|
+
fonts,
|
|
171
|
+
prose: defined(manualProse),
|
|
172
|
+
ui: defined(manualUI),
|
|
173
|
+
styles: Object.fromEntries(
|
|
174
|
+
Object.entries(overrides)
|
|
175
|
+
.filter(([, v]) => v !== undefined)
|
|
176
|
+
.map(([k, v]) => [k, defined(v!)])
|
|
177
|
+
)
|
|
178
|
+
},
|
|
179
|
+
prose,
|
|
180
|
+
ui,
|
|
181
|
+
styles,
|
|
182
|
+
tokens: typographyTokens(
|
|
183
|
+
styles,
|
|
184
|
+
Object.fromEntries(assignments.map(key => [key, fonts[key].family])) as Record<
|
|
185
|
+
TypographyAssignment,
|
|
186
|
+
string
|
|
187
|
+
>,
|
|
188
|
+
prose.paragraphSpacing
|
|
189
|
+
),
|
|
190
|
+
recommendations: {
|
|
191
|
+
body: !!profile,
|
|
192
|
+
ui: fonts.ui.profile === 'inter' || fonts.ui.profile === 'plex-sans'
|
|
193
|
+
},
|
|
194
|
+
warnings
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
function defined<T extends object>(value: T): T {
|
|
198
|
+
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== undefined)) as T
|
|
199
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/** Stable text styles; presentation is independent of the element's HTML semantics. */
|
|
2
|
+
export type TypographyRole =
|
|
3
|
+
| 'prose-title'
|
|
4
|
+
| 'prose-heading'
|
|
5
|
+
| 'prose-subheading'
|
|
6
|
+
| 'prose-body'
|
|
7
|
+
| 'prose-lead'
|
|
8
|
+
| 'prose-small'
|
|
9
|
+
| 'prose-quote'
|
|
10
|
+
| 'ui-title'
|
|
11
|
+
| 'ui-body'
|
|
12
|
+
| 'ui-label'
|
|
13
|
+
| 'ui-supporting'
|
|
14
|
+
| 'ui-caption'
|
|
15
|
+
| 'ui-metric'
|
|
16
|
+
| 'ui-eyebrow'
|
|
17
|
+
| 'display'
|
|
18
|
+
| 'code'
|
|
19
|
+
|
|
20
|
+
export type TypographyAssignment = 'body' | 'headings' | 'ui' | 'code'
|
|
21
|
+
export type TypographyProfile = 'inter' | 'source-serif-4' | 'plex-sans' | 'plex-mono' | 'manual'
|
|
22
|
+
export type TypographyPreset = 'inter' | 'source-serif' | 'plex'
|
|
23
|
+
|
|
24
|
+
export interface TypographyFont {
|
|
25
|
+
/** CSS font-family list; choosing it never loads a font. */
|
|
26
|
+
readonly family: string
|
|
27
|
+
/** Explicit provenance of a studied font. Omitted for an unfamiliar/manual font. */
|
|
28
|
+
readonly profile?: TypographyProfile
|
|
29
|
+
}
|
|
30
|
+
export interface TypographyProseRhythm {
|
|
31
|
+
/** Reference pixels at a 16px root, emitted as rem. */
|
|
32
|
+
readonly size: number
|
|
33
|
+
readonly lineHeight: number
|
|
34
|
+
readonly paragraphSpacing: number
|
|
35
|
+
readonly measure: number
|
|
36
|
+
readonly headingScale: number
|
|
37
|
+
}
|
|
38
|
+
export interface TypographyUIRhythm {
|
|
39
|
+
readonly size: number
|
|
40
|
+
readonly lineHeight: number
|
|
41
|
+
}
|
|
42
|
+
export interface TypographyStyle {
|
|
43
|
+
readonly assignment: TypographyAssignment
|
|
44
|
+
/** Reference pixels at a 16px root. */
|
|
45
|
+
readonly narrow: number
|
|
46
|
+
readonly wide: number
|
|
47
|
+
readonly weight: number
|
|
48
|
+
readonly lineHeight: number
|
|
49
|
+
/** em; zero is deliberately not the old global negative tracking. */
|
|
50
|
+
readonly tracking: number
|
|
51
|
+
/** ch; zero means the layout owns measure. */
|
|
52
|
+
readonly measure: number
|
|
53
|
+
}
|
|
54
|
+
export interface TypographyInput {
|
|
55
|
+
readonly preset?: TypographyPreset
|
|
56
|
+
readonly fonts?: Readonly<Partial<Record<TypographyAssignment, TypographyFont>>>
|
|
57
|
+
/** Only manual settings belong here; omission keeps a profile-derived default live. */
|
|
58
|
+
readonly prose?: Partial<TypographyProseRhythm>
|
|
59
|
+
readonly ui?: Partial<TypographyUIRhythm>
|
|
60
|
+
readonly styles?: Readonly<Partial<Record<TypographyRole, Partial<TypographyStyle>>>>
|
|
61
|
+
}
|
|
62
|
+
export interface TypographyRoleTokens {
|
|
63
|
+
readonly family: string
|
|
64
|
+
readonly size: string
|
|
65
|
+
readonly fluidSize: string
|
|
66
|
+
readonly weight: number | string
|
|
67
|
+
readonly lineHeight: string
|
|
68
|
+
readonly letterSpacing: string
|
|
69
|
+
readonly measure: string
|
|
70
|
+
}
|
|
71
|
+
export interface TypographyTokens {
|
|
72
|
+
readonly roles: Readonly<Record<TypographyRole, TypographyRoleTokens>>
|
|
73
|
+
readonly flow: {
|
|
74
|
+
readonly paragraph: string
|
|
75
|
+
readonly headingBefore: string
|
|
76
|
+
readonly headingAfter: string
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export interface TypographyResult {
|
|
80
|
+
/** Replayable input retains manual/automatic ownership rather than pinning computed defaults. */
|
|
81
|
+
readonly input: TypographyInput
|
|
82
|
+
readonly prose: TypographyProseRhythm
|
|
83
|
+
readonly ui: TypographyUIRhythm
|
|
84
|
+
readonly styles: Readonly<Record<TypographyRole, TypographyStyle>>
|
|
85
|
+
readonly tokens: TypographyTokens
|
|
86
|
+
readonly recommendations: { readonly body: boolean; readonly ui: boolean }
|
|
87
|
+
readonly warnings: readonly {
|
|
88
|
+
readonly role: TypographyRole
|
|
89
|
+
readonly requestedWeight: number
|
|
90
|
+
readonly supportedWeights: readonly [number, number]
|
|
91
|
+
}[]
|
|
92
|
+
}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/* Generated by scripts/generate-theme-css.mjs; same tokens for both CSS routes. */
|
|
2
|
+
@layer components {
|
|
3
|
+
:where([data-rad-type-container]) {
|
|
4
|
+
container-type: inline-size;
|
|
5
|
+
container-name: radiant-type;
|
|
6
|
+
}
|
|
7
|
+
:where([data-rad-prose]) {
|
|
8
|
+
font-family: var(--rad-typography-roles-prose-body-family);
|
|
9
|
+
font-size: var(--rad-typography-roles-prose-body-size);
|
|
10
|
+
font-weight: var(--rad-typography-roles-prose-body-weight);
|
|
11
|
+
line-height: var(--rad-typography-roles-prose-body-line-height);
|
|
12
|
+
letter-spacing: var(--rad-typography-roles-prose-body-letter-spacing);
|
|
13
|
+
max-inline-size: var(--rad-typography-roles-prose-body-measure);
|
|
14
|
+
overflow-wrap: anywhere;
|
|
15
|
+
}
|
|
16
|
+
:where([data-rad-text='prose-title']),
|
|
17
|
+
:where([data-rad-prose])
|
|
18
|
+
> :where(h1):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
19
|
+
font-family: var(--rad-typography-roles-prose-title-family);
|
|
20
|
+
font-size: var(--rad-typography-roles-prose-title-size);
|
|
21
|
+
font-weight: var(--rad-typography-roles-prose-title-weight);
|
|
22
|
+
line-height: var(--rad-typography-roles-prose-title-line-height);
|
|
23
|
+
letter-spacing: var(--rad-typography-roles-prose-title-letter-spacing);
|
|
24
|
+
max-inline-size: var(--rad-typography-roles-prose-title-measure);
|
|
25
|
+
font-optical-sizing: auto;
|
|
26
|
+
font-synthesis: none;
|
|
27
|
+
overflow-wrap: anywhere;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:where([data-rad-text='prose-heading']),
|
|
31
|
+
:where([data-rad-prose])
|
|
32
|
+
> :where(h2):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
33
|
+
font-family: var(--rad-typography-roles-prose-heading-family);
|
|
34
|
+
font-size: var(--rad-typography-roles-prose-heading-size);
|
|
35
|
+
font-weight: var(--rad-typography-roles-prose-heading-weight);
|
|
36
|
+
line-height: var(--rad-typography-roles-prose-heading-line-height);
|
|
37
|
+
letter-spacing: var(--rad-typography-roles-prose-heading-letter-spacing);
|
|
38
|
+
max-inline-size: var(--rad-typography-roles-prose-heading-measure);
|
|
39
|
+
font-optical-sizing: auto;
|
|
40
|
+
font-synthesis: none;
|
|
41
|
+
overflow-wrap: anywhere;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:where([data-rad-text='prose-subheading']),
|
|
45
|
+
:where([data-rad-prose])
|
|
46
|
+
> :where(h3, h4, h5, h6):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
47
|
+
font-family: var(--rad-typography-roles-prose-subheading-family);
|
|
48
|
+
font-size: var(--rad-typography-roles-prose-subheading-size);
|
|
49
|
+
font-weight: var(--rad-typography-roles-prose-subheading-weight);
|
|
50
|
+
line-height: var(--rad-typography-roles-prose-subheading-line-height);
|
|
51
|
+
letter-spacing: var(--rad-typography-roles-prose-subheading-letter-spacing);
|
|
52
|
+
max-inline-size: var(--rad-typography-roles-prose-subheading-measure);
|
|
53
|
+
font-optical-sizing: auto;
|
|
54
|
+
font-synthesis: none;
|
|
55
|
+
overflow-wrap: anywhere;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:where([data-rad-text='prose-body']),
|
|
59
|
+
:where([data-rad-prose])
|
|
60
|
+
> :where(p, ul, ol):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
61
|
+
font-family: var(--rad-typography-roles-prose-body-family);
|
|
62
|
+
font-size: var(--rad-typography-roles-prose-body-size);
|
|
63
|
+
font-weight: var(--rad-typography-roles-prose-body-weight);
|
|
64
|
+
line-height: var(--rad-typography-roles-prose-body-line-height);
|
|
65
|
+
letter-spacing: var(--rad-typography-roles-prose-body-letter-spacing);
|
|
66
|
+
max-inline-size: var(--rad-typography-roles-prose-body-measure);
|
|
67
|
+
font-optical-sizing: auto;
|
|
68
|
+
font-synthesis: none;
|
|
69
|
+
overflow-wrap: anywhere;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:where([data-rad-text='prose-lead']) {
|
|
73
|
+
font-family: var(--rad-typography-roles-prose-lead-family);
|
|
74
|
+
font-size: var(--rad-typography-roles-prose-lead-size);
|
|
75
|
+
font-weight: var(--rad-typography-roles-prose-lead-weight);
|
|
76
|
+
line-height: var(--rad-typography-roles-prose-lead-line-height);
|
|
77
|
+
letter-spacing: var(--rad-typography-roles-prose-lead-letter-spacing);
|
|
78
|
+
max-inline-size: var(--rad-typography-roles-prose-lead-measure);
|
|
79
|
+
font-optical-sizing: auto;
|
|
80
|
+
font-synthesis: none;
|
|
81
|
+
overflow-wrap: anywhere;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where([data-rad-text='prose-small']),
|
|
85
|
+
:where([data-rad-prose])
|
|
86
|
+
> :where(figcaption):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
87
|
+
font-family: var(--rad-typography-roles-prose-small-family);
|
|
88
|
+
font-size: var(--rad-typography-roles-prose-small-size);
|
|
89
|
+
font-weight: var(--rad-typography-roles-prose-small-weight);
|
|
90
|
+
line-height: var(--rad-typography-roles-prose-small-line-height);
|
|
91
|
+
letter-spacing: var(--rad-typography-roles-prose-small-letter-spacing);
|
|
92
|
+
max-inline-size: var(--rad-typography-roles-prose-small-measure);
|
|
93
|
+
font-optical-sizing: auto;
|
|
94
|
+
font-synthesis: none;
|
|
95
|
+
overflow-wrap: anywhere;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:where([data-rad-text='prose-quote']),
|
|
99
|
+
:where([data-rad-prose])
|
|
100
|
+
> :where(blockquote):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
101
|
+
font-family: var(--rad-typography-roles-prose-quote-family);
|
|
102
|
+
font-size: var(--rad-typography-roles-prose-quote-size);
|
|
103
|
+
font-weight: var(--rad-typography-roles-prose-quote-weight);
|
|
104
|
+
line-height: var(--rad-typography-roles-prose-quote-line-height);
|
|
105
|
+
letter-spacing: var(--rad-typography-roles-prose-quote-letter-spacing);
|
|
106
|
+
max-inline-size: var(--rad-typography-roles-prose-quote-measure);
|
|
107
|
+
font-optical-sizing: auto;
|
|
108
|
+
font-synthesis: none;
|
|
109
|
+
overflow-wrap: anywhere;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:where([data-rad-text='ui-title']) {
|
|
113
|
+
font-family: var(--rad-typography-roles-ui-title-family);
|
|
114
|
+
font-size: var(--rad-typography-roles-ui-title-size);
|
|
115
|
+
font-weight: var(--rad-typography-roles-ui-title-weight);
|
|
116
|
+
line-height: var(--rad-typography-roles-ui-title-line-height);
|
|
117
|
+
letter-spacing: var(--rad-typography-roles-ui-title-letter-spacing);
|
|
118
|
+
max-inline-size: var(--rad-typography-roles-ui-title-measure);
|
|
119
|
+
font-optical-sizing: auto;
|
|
120
|
+
font-synthesis: none;
|
|
121
|
+
overflow-wrap: anywhere;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:where([data-rad-text='ui-body']) {
|
|
125
|
+
font-family: var(--rad-typography-roles-ui-body-family);
|
|
126
|
+
font-size: var(--rad-typography-roles-ui-body-size);
|
|
127
|
+
font-weight: var(--rad-typography-roles-ui-body-weight);
|
|
128
|
+
line-height: var(--rad-typography-roles-ui-body-line-height);
|
|
129
|
+
letter-spacing: var(--rad-typography-roles-ui-body-letter-spacing);
|
|
130
|
+
max-inline-size: var(--rad-typography-roles-ui-body-measure);
|
|
131
|
+
font-optical-sizing: auto;
|
|
132
|
+
font-synthesis: none;
|
|
133
|
+
overflow-wrap: anywhere;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:where([data-rad-text='ui-label']) {
|
|
137
|
+
font-family: var(--rad-typography-roles-ui-label-family);
|
|
138
|
+
font-size: var(--rad-typography-roles-ui-label-size);
|
|
139
|
+
font-weight: var(--rad-typography-roles-ui-label-weight);
|
|
140
|
+
line-height: var(--rad-typography-roles-ui-label-line-height);
|
|
141
|
+
letter-spacing: var(--rad-typography-roles-ui-label-letter-spacing);
|
|
142
|
+
max-inline-size: var(--rad-typography-roles-ui-label-measure);
|
|
143
|
+
font-optical-sizing: auto;
|
|
144
|
+
font-synthesis: none;
|
|
145
|
+
overflow-wrap: anywhere;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:where([data-rad-text='ui-supporting']) {
|
|
149
|
+
font-family: var(--rad-typography-roles-ui-supporting-family);
|
|
150
|
+
font-size: var(--rad-typography-roles-ui-supporting-size);
|
|
151
|
+
font-weight: var(--rad-typography-roles-ui-supporting-weight);
|
|
152
|
+
line-height: var(--rad-typography-roles-ui-supporting-line-height);
|
|
153
|
+
letter-spacing: var(--rad-typography-roles-ui-supporting-letter-spacing);
|
|
154
|
+
max-inline-size: var(--rad-typography-roles-ui-supporting-measure);
|
|
155
|
+
font-optical-sizing: auto;
|
|
156
|
+
font-synthesis: none;
|
|
157
|
+
overflow-wrap: anywhere;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
:where([data-rad-text='ui-caption']) {
|
|
161
|
+
font-family: var(--rad-typography-roles-ui-caption-family);
|
|
162
|
+
font-size: var(--rad-typography-roles-ui-caption-size);
|
|
163
|
+
font-weight: var(--rad-typography-roles-ui-caption-weight);
|
|
164
|
+
line-height: var(--rad-typography-roles-ui-caption-line-height);
|
|
165
|
+
letter-spacing: var(--rad-typography-roles-ui-caption-letter-spacing);
|
|
166
|
+
max-inline-size: var(--rad-typography-roles-ui-caption-measure);
|
|
167
|
+
font-optical-sizing: auto;
|
|
168
|
+
font-synthesis: none;
|
|
169
|
+
overflow-wrap: anywhere;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:where([data-rad-text='ui-metric']) {
|
|
173
|
+
font-family: var(--rad-typography-roles-ui-metric-family);
|
|
174
|
+
font-size: var(--rad-typography-roles-ui-metric-size);
|
|
175
|
+
font-weight: var(--rad-typography-roles-ui-metric-weight);
|
|
176
|
+
line-height: var(--rad-typography-roles-ui-metric-line-height);
|
|
177
|
+
letter-spacing: var(--rad-typography-roles-ui-metric-letter-spacing);
|
|
178
|
+
max-inline-size: var(--rad-typography-roles-ui-metric-measure);
|
|
179
|
+
font-optical-sizing: auto;
|
|
180
|
+
font-synthesis: none;
|
|
181
|
+
overflow-wrap: anywhere;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:where([data-rad-text='ui-eyebrow']) {
|
|
185
|
+
font-family: var(--rad-typography-roles-ui-eyebrow-family);
|
|
186
|
+
font-size: var(--rad-typography-roles-ui-eyebrow-size);
|
|
187
|
+
font-weight: var(--rad-typography-roles-ui-eyebrow-weight);
|
|
188
|
+
line-height: var(--rad-typography-roles-ui-eyebrow-line-height);
|
|
189
|
+
letter-spacing: var(--rad-typography-roles-ui-eyebrow-letter-spacing);
|
|
190
|
+
max-inline-size: var(--rad-typography-roles-ui-eyebrow-measure);
|
|
191
|
+
font-optical-sizing: auto;
|
|
192
|
+
font-synthesis: none;
|
|
193
|
+
overflow-wrap: anywhere;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:where([data-rad-text='display']) {
|
|
197
|
+
font-family: var(--rad-typography-roles-display-family);
|
|
198
|
+
font-size: var(--rad-typography-roles-display-size);
|
|
199
|
+
font-weight: var(--rad-typography-roles-display-weight);
|
|
200
|
+
line-height: var(--rad-typography-roles-display-line-height);
|
|
201
|
+
letter-spacing: var(--rad-typography-roles-display-letter-spacing);
|
|
202
|
+
max-inline-size: var(--rad-typography-roles-display-measure);
|
|
203
|
+
font-optical-sizing: auto;
|
|
204
|
+
font-synthesis: none;
|
|
205
|
+
overflow-wrap: anywhere;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
:where([data-rad-text='code']),
|
|
209
|
+
:where([data-rad-prose])
|
|
210
|
+
> :where(pre):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
211
|
+
font-family: var(--rad-typography-roles-code-family);
|
|
212
|
+
font-size: var(--rad-typography-roles-code-size);
|
|
213
|
+
font-weight: var(--rad-typography-roles-code-weight);
|
|
214
|
+
line-height: var(--rad-typography-roles-code-line-height);
|
|
215
|
+
letter-spacing: var(--rad-typography-roles-code-letter-spacing);
|
|
216
|
+
max-inline-size: var(--rad-typography-roles-code-measure);
|
|
217
|
+
font-optical-sizing: auto;
|
|
218
|
+
font-synthesis: none;
|
|
219
|
+
overflow-wrap: anywhere;
|
|
220
|
+
}
|
|
221
|
+
:where([data-rad-prose])
|
|
222
|
+
> :where(p, ul, ol, figure, blockquote, pre, h1, h2, h3, h4, h5, h6):not(
|
|
223
|
+
:where([data-rad-not-prose], [data-slot])
|
|
224
|
+
) {
|
|
225
|
+
margin-block: 0;
|
|
226
|
+
}
|
|
227
|
+
:where([data-rad-prose])
|
|
228
|
+
> :where(p, ul, ol, figure, blockquote, pre, h1, h2, h3, h4, h5, h6):not(
|
|
229
|
+
:where([data-rad-not-prose], [data-slot])
|
|
230
|
+
)
|
|
231
|
+
+ :where(p, ul, ol, figure, blockquote, pre, h1, h2, h3, h4, h5, h6):not(
|
|
232
|
+
:where([data-rad-not-prose], [data-slot])
|
|
233
|
+
) {
|
|
234
|
+
margin-block-start: var(--rad-typography-flow-paragraph);
|
|
235
|
+
}
|
|
236
|
+
:where([data-rad-prose])
|
|
237
|
+
> :where(p, ul, ol, figure, blockquote, pre, h1, h2, h3, h4, h5, h6):not(
|
|
238
|
+
:where([data-rad-not-prose], [data-slot])
|
|
239
|
+
)
|
|
240
|
+
+ :where(h1, h2, h3, h4, h5, h6):not(:where([data-rad-not-prose], [data-slot])) {
|
|
241
|
+
margin-block-start: var(--rad-typography-flow-heading-before);
|
|
242
|
+
}
|
|
243
|
+
:where([data-rad-prose])
|
|
244
|
+
> :where(h1, h2, h3, h4, h5, h6):not(:where([data-rad-not-prose], [data-slot]))
|
|
245
|
+
+ :where(p, ul, ol, figure, blockquote, pre, h1, h2, h3, h4, h5, h6):not(
|
|
246
|
+
:where([data-rad-not-prose], [data-slot])
|
|
247
|
+
) {
|
|
248
|
+
margin-block-start: var(--rad-typography-flow-heading-after);
|
|
249
|
+
}
|
|
250
|
+
:where([data-rad-prose]) > :where(ul, ol) {
|
|
251
|
+
padding-inline-start: 1.25em;
|
|
252
|
+
}
|
|
253
|
+
:where([data-rad-prose]) > :where(pre),
|
|
254
|
+
:where([data-rad-text='code']) {
|
|
255
|
+
overflow: auto;
|
|
256
|
+
white-space: pre;
|
|
257
|
+
overflow-wrap: normal;
|
|
258
|
+
}
|
|
259
|
+
:where([data-rad-prose])
|
|
260
|
+
> :where(p, ul, ol, li, blockquote, h1, h2, h3, h4, h5, h6)
|
|
261
|
+
:where(code):not(:where(pre code)) {
|
|
262
|
+
font-family: var(--rad-typography-roles-code-family);
|
|
263
|
+
font-size: 0.9em;
|
|
264
|
+
font-weight: inherit;
|
|
265
|
+
line-height: inherit;
|
|
266
|
+
letter-spacing: 0;
|
|
267
|
+
}
|
|
268
|
+
:where([data-rad-prose]) > :where(pre) > :where(code) {
|
|
269
|
+
font: inherit;
|
|
270
|
+
letter-spacing: inherit;
|
|
271
|
+
}
|
|
272
|
+
@container radiant-type (min-width: 0px) {
|
|
273
|
+
:where([data-rad-text='prose-title']),
|
|
274
|
+
:where([data-rad-prose])
|
|
275
|
+
> :where(h1):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
276
|
+
font-size: var(--rad-typography-roles-prose-title-fluid-size);
|
|
277
|
+
}
|
|
278
|
+
:where([data-rad-text='prose-heading']),
|
|
279
|
+
:where([data-rad-prose])
|
|
280
|
+
> :where(h2):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
281
|
+
font-size: var(--rad-typography-roles-prose-heading-fluid-size);
|
|
282
|
+
}
|
|
283
|
+
:where([data-rad-text='prose-subheading']),
|
|
284
|
+
:where([data-rad-prose])
|
|
285
|
+
> :where(h3, h4, h5, h6):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
286
|
+
font-size: var(--rad-typography-roles-prose-subheading-fluid-size);
|
|
287
|
+
}
|
|
288
|
+
:where([data-rad-text='prose-body']),
|
|
289
|
+
:where([data-rad-prose])
|
|
290
|
+
> :where(p, ul, ol):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
291
|
+
font-size: var(--rad-typography-roles-prose-body-fluid-size);
|
|
292
|
+
}
|
|
293
|
+
:where([data-rad-text='prose-lead']) {
|
|
294
|
+
font-size: var(--rad-typography-roles-prose-lead-fluid-size);
|
|
295
|
+
}
|
|
296
|
+
:where([data-rad-text='prose-small']),
|
|
297
|
+
:where([data-rad-prose])
|
|
298
|
+
> :where(figcaption):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
299
|
+
font-size: var(--rad-typography-roles-prose-small-fluid-size);
|
|
300
|
+
}
|
|
301
|
+
:where([data-rad-text='prose-quote']),
|
|
302
|
+
:where([data-rad-prose])
|
|
303
|
+
> :where(blockquote):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
304
|
+
font-size: var(--rad-typography-roles-prose-quote-fluid-size);
|
|
305
|
+
}
|
|
306
|
+
:where([data-rad-text='ui-title']) {
|
|
307
|
+
font-size: var(--rad-typography-roles-ui-title-fluid-size);
|
|
308
|
+
}
|
|
309
|
+
:where([data-rad-text='ui-body']) {
|
|
310
|
+
font-size: var(--rad-typography-roles-ui-body-fluid-size);
|
|
311
|
+
}
|
|
312
|
+
:where([data-rad-text='ui-label']) {
|
|
313
|
+
font-size: var(--rad-typography-roles-ui-label-fluid-size);
|
|
314
|
+
}
|
|
315
|
+
:where([data-rad-text='ui-supporting']) {
|
|
316
|
+
font-size: var(--rad-typography-roles-ui-supporting-fluid-size);
|
|
317
|
+
}
|
|
318
|
+
:where([data-rad-text='ui-caption']) {
|
|
319
|
+
font-size: var(--rad-typography-roles-ui-caption-fluid-size);
|
|
320
|
+
}
|
|
321
|
+
:where([data-rad-text='ui-metric']) {
|
|
322
|
+
font-size: var(--rad-typography-roles-ui-metric-fluid-size);
|
|
323
|
+
}
|
|
324
|
+
:where([data-rad-text='ui-eyebrow']) {
|
|
325
|
+
font-size: var(--rad-typography-roles-ui-eyebrow-fluid-size);
|
|
326
|
+
}
|
|
327
|
+
:where([data-rad-text='display']) {
|
|
328
|
+
font-size: var(--rad-typography-roles-display-fluid-size);
|
|
329
|
+
}
|
|
330
|
+
:where([data-rad-text='code']),
|
|
331
|
+
:where([data-rad-prose])
|
|
332
|
+
> :where(pre):not(:where([data-rad-text], [data-rad-not-prose], [data-slot])) {
|
|
333
|
+
font-size: var(--rad-typography-roles-code-fluid-size);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|