Variable Font Feature Axis Tester
Adjust dynamic properties across supported modern fonts. Tune weight, width, slant, optical size, and OpenType features live, then copy the generated CSS.
The Complete Guide to CSS Variable Fonts and OpenType Feature Control
Variable fonts are one of the most practical advances in web typography since web fonts themselves. A single file replaces an entire family of static weights, widths, and styles, and CSS gives you direct access to every axis. This guide covers how variable fonts work, how to use this tester effectively, and how to write production-ready CSS for any modern browser.
How to Use This Tester
Select a font preset from Column 1 or paste a direct URL to any .woff2 or .ttf variable font file and click Load. The font loads via the browser's FontFace API entirely on your device - no file is uploaded to any server. Then drag any axis slider and watch the canvas in Column 2 update instantly. Column 3 always shows the exact CSS you need to replicate the current state. Click Copy CSS and paste it directly into your stylesheet.
The preview canvas is fully editable. Click anywhere in the text and type your own words or numbers to test ligatures, tabular figure alignment, and how the font handles your actual content at your chosen axis settings.
Understanding the Five Registered Axes
The wght (weight) axis is the most widely supported, ranging from 100 (thin) to 1000 (ultra-black). Most variable fonts include at least this axis. The wdth (width) axis scales letterforms horizontally as a percentage of their default width, from condensed around 50 to expanded around 150. The slnt (slant) axis leans glyphs without switching to a separately drawn italic, using negative degree values. The ital (italic) axis switches between the upright design (0) and the full italic design (1), and some fonts support fractional values for gradual transitions. The opsz (optical size) axis adjusts contrast and spacing to remain readable from small caption sizes to large display headlines.
Not every font supports all five axes. When an axis in your font-variation-settings declaration is not supported by the loaded font, the browser silently ignores that axis and applies the others without error.
OpenType Feature Settings in Practice
Standard ligatures (liga) are enabled by default in most browsers. Turning them off can be useful in code or tabular contexts where fi or fl ligatures might confuse character recognition. Discretionary ligatures (dlig) include decorative combinations the designer considered optional, such as st or ct ligatures, and are off by default. Tabular figures (tnum) assign each digit the same advance width, essential for aligning columns of numbers in financial tables. The slashed zero (zero) replaces the digit 0 with a visually distinguished slashed form to prevent confusion with the uppercase letter O, useful in code and serial numbers.
Performance and Loading Strategy
Preload your variable font with a link tag using rel="preload" and as="font" and type="font/woff2" to ensure it loads as early as possible. Add crossorigin="anonymous" even for same-origin fonts, because the browser's font loader always uses CORS. Use the unicode-range descriptor in your @font-face block to limit the font to the character sets you actually use - this allows browsers to download only the subsets needed for the current page. For Google Fonts variable fonts, the API URL syntax uses ranges like [email protected] to request the full axis range.
CSS Animation and Transitions with Variable Fonts
Variable font axes can be smoothly animated with CSS transitions or keyframes. For high-level properties like font-weight, transitions work exactly as expected. For font-variation-settings, the browser interpolates between two values only if both declarations contain identical axis lists in the same order. If the axis lists differ, the browser snaps rather than interpolates. A practical pattern is to set all axes in a single font-variation-settings declaration and transition that property, ensuring consistent interpolation across all axes simultaneously.