sanity
Version:
Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches
26 lines (23 loc) • 793 B
text/typescript
import {studioTheme as defaults, type ThemeFonts} from '@sanity/ui'
import {type LegacyThemeProps} from './types'
export function buildFonts(cssCustomProperties: LegacyThemeProps): ThemeFonts {
return {
...defaults.fonts,
code: {
...defaults.fonts.code,
family: cssCustomProperties['--font-family-monospace'] || defaults.fonts.code.family,
},
heading: {
...defaults.fonts.heading,
family: cssCustomProperties['--font-family-base'] || defaults.fonts.code.family,
},
label: {
...defaults.fonts.label,
family: cssCustomProperties['--font-family-base'] || defaults.fonts.code.family,
},
text: {
...defaults.fonts.text,
family: cssCustomProperties['--font-family-base'] || defaults.fonts.code.family,
},
}
}