javascript —

Taming Typography: Building a Modern CSS Reset

CSS can now make choices about type that used to sit outside a reset. text-wrap: pretty can prevent a stranded word, container query units can scale a heading to the column it occupies, and text-box can trim the half-leading built into a line box.

Taming Typography: Building a Modern CSS Reset

Some of these features are experimental and browser support is uneven, so they need guardrails rather than blind inclusion. I've put together tidy-typography.css, which gathers the useful parts into a default stylesheet: rendering and fallback rules, fluid sizing, vertical rhythm, wrapping, hyphenation, and OpenType detail.

Use it whole, or take the declaration that solves the particular irritation in front of you. I'll walk you through all the details in this article and give you the full code at the end.

Earlier coverage

Reported by css-tricks.com.

javascriptcloud

Related coverage

Elsewhere in this edition