Skip to content
Daniel Wentsch

Things read, heard, watched and found. Now and then a thought of my own.

Timeline
Article

LH Units Are Cool - Andy Bell

Andy Bell

14 Dec 2023

I’ve used em, ch and ex units to size icons in contexts like buttons so font sizes icon sizes are nice and synced. Using ex units is especially useful because 1ex is the height of the x character in the chosen font and size.

The lh unit is even more useful though because it is relative to the computed line height. This makes sizing icons relatively and aligning them relatively, much easier.