Skip to main content

Default Scale

Reference for the default typography scale values included with Fluid Typography.

DEFAULT_SCALE

The complete default typography scale exported from the plugin.

export const DEFAULT_SCALE: Record<string, ScaleTuple>

Scale Values

Display (Hero Sections)

Scale NameValueMobile SizeDesktop SizeDescription
display-2xl[48, 72]48px72pxMassive hero titles
display-xl[40, 60]40px60pxLarge hero titles
display-lg[32, 48]32px48pxMedium hero titles
display[28, 36]28px36pxSmall hero titles

Headings

Scale NameValueMobile SizeDesktop SizeDescription
h1[28, 36]28px36pxMain page headings (matches text-4xl)
h2[24, 30]24px30pxSection headings (matches text-3xl)
h3[20, 24]20px24pxSubsection headings (matches text-2xl)

Body Text

Scale NameValueMobile SizeDesktop SizeTailwind Equivalent
body[14, 16]14px16pxtext-base
body-sm[13, 14]13px14pxtext-sm
body-xs[11, 12]11px12pxtext-xs

Small Text

Scale NameValueMobile SizeDesktop SizeDescription
caption[10, 11]10px11pxImage captions, footnotes
overline[10, 11]10px11pxLabels (uppercase)

Usage in Code

Import and Use

import { DEFAULT_SCALE } from 'fluid-typography'

// Get a specific scale
const h1Scale = DEFAULT_SCALE['h1'] // [28, 36]
const bodyScale = DEFAULT_SCALE.body // [14, 16]

// Iterate over all scales
Object.entries(DEFAULT_SCALE).forEach(([name, [min, max]]) => {
console.log(`${name}: ${min}px → ${max}px`)
})

Extend Default Scale

import { DEFAULT_SCALE } from 'fluid-typography'
import type { ScaleTuple } from 'fluid-typography'

// Create extended scale
const extendedScale: Record<string, ScaleTuple> = {
...DEFAULT_SCALE,
'custom-xl': [50, 80],
'custom-sm': [12, 14]
}

Reference in Config

import { DEFAULT_SCALE } from 'fluid-typography'

// Use scale values for other purposes
export default {
theme: {
extend: {
spacing: {
'hero-text': `${DEFAULT_SCALE['display-xl'][1]}px` // 60px
}
}
}
}

Full Scale Object

export const DEFAULT_SCALE = {
// Display
'display-2xl': [48, 72],
'display-xl': [40, 60],
'display-lg': [32, 48],
'display': [28, 36],

// Headings
'h1': [28, 36],
'h2': [24, 30],
'h3': [20, 24],

// Body
'body': [14, 16],
'body-sm': [13, 14],
'body-xs': [11, 12],

// Small
'caption': [10, 11],
'overline': [10, 11]
}

Additional Properties

Default typography classes also include these properties:

Display Styles

ClassLine HeightFont WeightLetter Spacing
text-display-2xl1.0800-0.02em
text-display-xl1.05800-0.02em
text-display-lg1.1700-0.015em
text-display1.1700-0.015em

Heading Styles

ClassLine HeightFont WeightLetter Spacing
text-h11.2700-0.015em
text-h21.3700-0.01em
text-h31.4600-

Body Styles

ClassLine HeightFont Weight
text-body1.5400
text-body-sm1.5400
text-body-xs1.5400

Small Text Styles

ClassLine HeightFont WeightLetter SpacingText Transform
text-caption1.4400--
text-overline1.56000.1emuppercase

Design Rationale

Mobile Sizes (375px viewport)

Optimized for readability on small screens:

  • Hero text remains impactful but fits the viewport
  • Body text is large enough to read comfortably
  • Spacing scaled appropriately for touch interfaces

Desktop Sizes (1440px viewport)

Matches Tailwind's default sizes where appropriate:

  • text-body = text-base (16px) - familiar mental model
  • text-body-sm = text-sm (14px)
  • text-body-xs = text-xs (12px)
  • Display and heading sizes optimized for large screens

Fluid Scaling

Between 375px and 1440px viewports, sizes scale smoothly using CSS clamp():

/* Example: text-h1 */
font-size: clamp(1.75rem, 1.5739rem + 0.7512vw, 2.25rem);
/* └─ 28px └─ dynamic calculation └─ 36px */

Comparison with Tailwind Defaults

Fluid TypographyTailwind CSSMobileDesktop
text-h1text-4xl28px36px
text-h2text-3xl24px30px
text-h3text-2xl20px24px
text-bodytext-base14px16px
text-body-smtext-sm13px14px
text-body-xstext-xs11px12px

Why Different on Mobile?

Fluid Typography scales down on mobile for:

  • Better readability in constrained viewports
  • Improved information density
  • Reduced horizontal scrolling
  • Better touch interface spacing

Accessing in Components

import { DEFAULT_SCALE } from 'fluid-typography'

// Use for calculations
function FontSizeDemo() {
const [min, max] = DEFAULT_SCALE['h1']

return (
<div>
<p>H1 scales from {min}px to {max}px</p>
<h1 className="text-h1">Example Heading</h1>
</div>
)
}

Next Steps