Fonts & type
Fonts the shadcn way, a modular type scale, and type presets that restyle every heading, figure and paragraph at once.
Two kinds of font
Install fonts
One item per role. Body fonts set --font-sans, heading fonts --font-heading, mono fonts --font-mono:
pnpm dlx shadcn@latest add https://glasscn.app/r/font-inter.json https://glasscn.app/r/font-heading-fraunces.json https://glasscn.app/r/font-mono-jetbrains-mono.jsonfont-geistfont-heading-geistfont-interfont-heading-interfont-figtreefont-heading-figtreefont-manropefont-heading-manropefont-dm-sansfont-heading-dm-sansfont-plus-jakarta-sansfont-heading-plus-jakarta-sansfont-outfitfont-heading-outfitfont-sorafont-heading-sorafont-onestfont-heading-onestfont-ibm-plex-sansfont-heading-ibm-plex-sansfont-nunitofont-heading-nunitofont-heading-space-groteskfont-space-groteskfont-heading-bricolage-grotesquefont-bricolage-grotesquefont-heading-frauncesfont-frauncesfont-heading-instrument-seriffont-instrument-seriffont-heading-newsreaderfont-newsreaderfont-heading-playfair-displayfont-playfair-displayfont-heading-lorafont-lorafont-heading-source-serif-4font-source-serif-4font-heading-ibm-plex-seriffont-ibm-plex-seriffont-mono-geist-monofont-mono-jetbrains-monofont-mono-ibm-plex-monofont-mono-dm-monofont-mono-space-monoType presets
A type preset sets the scale, leading, weights, tracking, case and numerals — and installs its fonts. type-system is the Apple look: San Francisco with SF Rounded figures, nothing to load.
pnpm dlx shadcn@latest add https://glasscn.app/r/type-editorial.jsonThe scale
Every size is a step: 1rem × --glass-text-scale × --glass-type-ratio^n, as Tailwind utilities type-step-n2 … type-step-6. Change the ratio and every heading moves together. Defaults (major third, 1.25):
type-step-661.04pxSmall gainstype-step-548.83pxSmall gainstype-step-439.06pxSmall gainstype-step-331.25pxSmall gainstype-step-225pxSmall gainstype-step-120pxSmall gainstype-step-016pxSmall gainstype-step-n112.8pxSmall gainstype-step-n210.24pxSmall gainsUtilities
<body className="type-glass"> {/* body font, leading, tracking, weight, features */}
<h2 className="type-glass-heading type-step-3"> {/* heading face at step 3 of the scale */}
<span className="type-glass-display type-step-6">1,826</span>
<code className="font-glass-mono">carryId</code>type-glass (body), type-glass-heading, type-glass-display, font-glass-sans | heading | display | mono, numeric-glass, type-step-*, and glass-prose (the Prose component) for rich text. All read the Fonts and Type tokens.
At runtime
import { ThemeScope } from "@/components/glass/theme-scope"
// a type preset, its fonts loaded for you
<ThemeScope type="editorial" loadFonts>…</ThemeScope>
// or pick fonts by catalogue key (or any CSS stack)
<ThemeScope fonts={{ heading: "fraunces", sans: "inter", mono: "jetbrains-mono" }} loadFonts>…</ThemeScope>
// or straight on an element — load the font yourself
<section className="[--glass-font-heading:Fraunces,serif] [--glass-type-ratio:1.414]">…</section>