Article
LH Units Are Cool - Andy Bell
Andy Bell
Read on andy-bell.co.uk
(opens in a new tab)
1 highlight ·
Dec 2023
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.