Leading-Trim: The Future of Digital Typesetting

How an emerging CSS standard can fix old problems and raise the bar for web apps

Ethan Wang
Aug 18 · 9 min read
Image for post
Image for post

The problem with text boxes today

Image for post
Image for post

How we got here: a history lesson

Image for post
Image for post
Image for post
Image for post
Leading was split in half and put above and below each line since CSS1. The browser window shown above is Internet Explorer 3.0. IE3 was the first commercial browser with CSS support. The font used is Verdana, released with the Core Fonts for the web project initiated by Microsoft back in 1996. In case you are wondering, the curves in the browser chrome are not a watermark.
Image for post
Image for post
The anatomy of your average text box

Workarounds are just workarounds

Introducing leading-trim

Image for post
Image for post
h1 { 
text-edge: cap alphabetic;
leading-trim: both;
}
Image for post
Image for post

Leading-trim fixes alignment issues

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Other immediate impacts: consistency and workflow improvements

Image for post
Image for post
A spacing system applied to text elements without leading-trim 😕

Small change, big implications

Microsoft’s role in this effort

Special thanks

Questions or comments?

Reference

Microsoft Design

Stories from the thinkers and tinkerers at Microsoft

Thanks to Chris Caruso and Joline Tang

Ethan Wang

Written by

Move whole pixels at Microsoft

Microsoft Design

Stories from the thinkers and tinkerers at Microsoft. Sharing sketches, designs, and everything in between.

Ethan Wang

Written by

Move whole pixels at Microsoft

Microsoft Design

Stories from the thinkers and tinkerers at Microsoft. Sharing sketches, designs, and everything in between.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store