Sjors Wijsman
Aug 21, 2021

--

Thank you! In general, I try to avoid using px as much as possible. When I want something to be super thin, like a border or an outline, I usually use 1px. There's also an annoying issue where using the same rem value for width & height doesn't result in a square element, I think it has to do with the browser rounding it up/down to the nearest screen pixel. So for small elements (<20px) I also tend to use pixels instead of scaled rems.

For everything else, it’s viewport units & rems all the way. Em is also useful for stuff that has to scale with text elements, like text margins, paddings & shadows. This allows you to use the same styling for headers & smaller text elements while only having to change the desired font-size.

--

--

Sjors Wijsman
Sjors Wijsman

Written by Sjors Wijsman

Freelance Frontend Developer. Studied Communication & Multimedia Design at HvA.

No responses yet