Fluid typography in theme.json, and why inline font sizes break mobile, Pattern Paste Canonical: https://patternpaste.com/blog/theme-json-fluid-typography/ Blog (https://patternpaste.com/blog/) Reference # Fluid typography in theme.json, and why inline font sizes break mobile How to configure clamp-based fluid typography in theme.json, why manual font overrides break mobile viewports, and how to structure portable type steps. Jake 29 August 2026 2 min read Setting custom pixel font sizes inside the block inspector breaks responsive layouts on smaller screens. When you assign an explicit font size like 56px to a heading in the editor sidebar, WordPress writes an inline CSS style attribute directly into the block markup. That fixed pixel value overrides viewport scaling, forcing a desktop-sized headline onto mobile screens until you write custom CSS media queries to fix it. Modern block themes solve this globally through theme.json fluid typography. When enabled, WordPress compiles named typography steps into dynamic CSS clamp() functions that scale smoothly between mobile and desktop viewports without custom stylesheets. ## How WordPress calculates fluid clamp values# When you enable fluid typography in theme.json, WordPress intercepts your font size declarations and compiles them into mathematical clamp() rules. The calculation uses minimum and maximum viewport thresholds to scale the font linearly between screen widths: { "version": 3, "settings": { "typography": { "fluid": true, "fontSizes": [ { "slug": "small", "size": "0.875rem", "name": "Small" }, { "slug": "medium", "size": "1rem", "name": "Medium" }, { "slug": "large", "size": "1.75rem", "name": "Large", "fluid": { "min": "1.25rem", "max": "1.75rem" } }, { "slug": "x-large", "size": "2.75rem", "name": "Extra Large", "fluid": { "min": "1.75rem", "max": "2.75rem" } } ] } } } On render, WordPress outputs CSS custom properties on :root that define the dynamic curve: :root { --wp--preset--font-size--small: 0.875rem; --wp--preset--font-size--medium: 1rem; --wp--preset--font-size--large: clamp(1.25rem, 1.25rem + ((1vw - 0.2rem) * 0.781), 1.75rem); --wp--preset--font-size--x-large: clamp(1.75rem, 1.75rem + ((1vw - 0.2rem) * 1.563), 2.75rem); } When a heading or paragraph uses the has-x-large-font-size class, the browser adjusts the rendered size continuously as the viewport changes width. No breakpoint jumps or device-specific media queries are needed. ## Configuring global fluid boundaries# By default, WordPress calculates fluid curves between a minimum viewport width of 320px and a maximum viewport width of 1600px. If your site layout caps at a narrower container (for example, 1200px), you can define explicit viewport boundaries inside the settings.typography.fluid object: { "version": 3, "settings": { "typography": { "fluid": { "minViewportWidth": "375px", "maxViewportWidth": "1280px" } } } } This prevents headline sizes from expanding beyond their intended proportions on ultra-wide desktop monitors while preserving readable proportions on mobile phones. ## Why inline font sizes break pattern portability# When you paste a third-party block pattern or export a custom layout, inspect the block markup for hardcoded fontSize values: