Image for post
Image for post

One of the many challenges when it comes to writing CSS is choosing the right unit. Over the years there has been a lot of controversy whether to use px, em or rem to size text. So I thought, why not add some custom properties to this mixture and see where it leads us. To not overcomplicate things and quickly get to the point, I will first describe my current approach when it comes to handling font-sizes. In part two, I will sprinkle in some custom properties.

Part I: My Current Approach (without custom properties)

TL/DR: Percentages at the Root, rem for Components, em for everything else (yes everything!). …


Nils Binder

Hey, I'm a UI/UX designer and part-time coder @9elements. Also, I'm an origami enthusiast spending hours folding paper.

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