Learn how to customize typography scales, override defaults, and create your own font combinations in Fonttrio.
While Fonttrio pairings come with carefully crafted typography scales, every project has unique design requirements. This guide shows you how to customize font sizes, weights, line heights, and create custom combinations.
@layer base { /* Lighter headings for a more elegant feel */ h1 { font-weight: 600; /* Changed from 700 */ } /* Bolder body text for better readability */ body, p { font-weight: 500; /* Changed from 400 */ }}
@layer base { /* Tighter line height for display headings */ h1 { line-height: 1.1; /* Changed from 1.2 */ } /* More spacious body text */ body, p { line-height: 1.75; /* Changed from 1.65 */ }}
@layer base { /* Tighter tracking for bold headings */ h1 { letter-spacing: -0.03em; /* Changed from -0.025em */ } /* Looser tracking for better legibility at small sizes */ body, p { letter-spacing: 0.01em; /* Added tracking */ }}
Changes to globals.css affect all instances of these elements throughout your app. For component-specific overrides, use Tailwind classes or CSS modules.
@layer base { :root { /* Use body font for headings instead */ --font-heading: var(--font-source-serif-4); /* Use heading font for body */ --font-body: var(--font-playfair-display); }}
Override the CSS variables to create your custom combination.
app/globals.css
@layer base { :root { /* Playfair Display from Editorial */ --font-heading: var(--font-playfair-display); /* Inter from Minimal */ --font-body: var(--font-inter); /* Keep JetBrains Mono from either */ --font-mono: var(--font-jetbrains-mono); }}
3
Apply to Layout
Import the fonts in your layout.
app/layout.tsx
import { playfairDisplay } from "@/registry/fonts/playfair-display";import { inter } from "@/registry/fonts/inter";import { jetbrainsMono } from "@/registry/fonts/jetbrains-mono";export default function RootLayout({ children }) { return ( <html className={` ${playfairDisplay.variable} ${inter.variable} ${jetbrainsMono.variable} `}> <body>{children}</body> </html> );}
4
Customize the Scale
Adjust typography scale to match your custom pairing.
app/globals.css
@layer base { h1 { font-family: var(--font-heading); font-size: 3rem; font-weight: 700; /* Playfair works well at 700 */ line-height: 1.1; letter-spacing: -0.03em; } body, p { font-family: var(--font-body); font-size: 1rem; font-weight: 400; /* Inter default weight */ line-height: 1.6; }}
When creating custom pairings, test thoroughly to ensure the fonts complement each other. Consider contrast (serif vs sans), weight, and x-height compatibility.
Experiment with the customizer, then copy the resulting CSS to your project.
The customizer on the preview site is for experimentation only. Changes are not saved or exported automatically. Note your preferred values and apply them manually to globals.css.