Taming Typography: Building a Modern CSS Reset
CSS-Tricks has introduced a modern CSS reset for typography, tackling rendering and fallback issues. The reset, called tidy-typography.css, aims to simplify typography styling.
Original reporting · css-tricks.com
Read “Taming Typography: Building a Modern CSS Reset” at CSS-Tricks →
How this was written. GDS wrote this article with a language model from CSS-Tricks’s reporting (model: @cf/meta/llama-3.3-70b-instruct-fp8-fast); it describes that reporting rather than adding to it. The original, linked above, is the full story.
Key points from CSS-Tricks’s report
- The tidy-typography.css stylesheet provides a comprehensive solution for typography styling issues.
- The reset includes features such as rendering and fallback sanity, fluid typography, and vertical rhythm.
- It also covers hyphenation, hanging punctuation, and ink-aware underlines, among other aspects of typography.
CSS-Tricks reported the release of tidy-typography.css, a default stylesheet that gathers useful typography features into one place. The stylesheet includes rendering and fallback rules, fluid sizing, vertical rhythm, wrapping, hyphenation, and OpenType detail.
The tidy-typography.css stylesheet addresses various typography issues, such as rendering and fallback sanity, which can be achieved by setting html and body font properties. For instance, setting font-synthesis to none stops a browser from inventing bold or italic when the family lacks that face.
Fluid typography is another key aspect of the reset, allowing for viewport-based fluid type that scales according to the container size. This is made possible by using container-type and cqi units, which enable headings to scale appropriately in different container widths.
Vertical rhythm is also improved with the reset, which trims the half-leading built into a line box using text-box-trim and text-box-edge properties. This ensures that text aligns tightly with other elements, and it is a metrics-aware alternative to font-specific negative-margin nudges.
The reset also includes features for balanced headlines and orphan-free paragraphs, achieved through text-wrap properties such as balance and pretty. These properties replace the need for JavaScript orphan fixers and provide a more efficient way to handle text wrapping.
Hyphenation is also properly tuned in the reset, relying on the browser's language dictionaries to determine where to break words. The reset includes properties such as hyphens, hyphenate-limit-chars, and hyphenate-limit-lines to control hyphenation frequency and prevent excessive hyphenation.
The tidy-typography.css stylesheet also covers other aspects of typography, including hanging punctuation and ink-aware underlines, variable font fine-tuning, and numeric, emoji, and script-aware text. These features work together to provide a comprehensive typography reset that simplifies the styling process.
Questions and answers
What is the purpose of the tidy-typography.css stylesheet?
The purpose of the tidy-typography.css stylesheet is to provide a comprehensive solution for typography styling issues, simplifying the process of styling text on the web.
How does the reset handle fluid typography?
The reset handles fluid typography by using container-type and cqi units, allowing headings to scale according to the container size.
What is the benefit of using text-box-trim and text-box-edge properties?
The benefit of using text-box-trim and text-box-edge properties is that they provide a metrics-aware alternative to font-specific negative-margin nudges, ensuring that text aligns tightly with other elements.



