3 ms·
> Extra wide 2XL breakpoint, for designing at 1536px and above Is it still common for folks to use pixels in their CSS? I moved to em and the rest around 1999
by mixmastamyk 6y ago
> Extra wide 2XL breakpoint, for designing at 1536px and above
Is it still common for folks to use pixels in their CSS? I moved to em and the rest around 1999 (I think). What is the reason to stick to pixels?
- Wolfr_ 6y agoMost people use rem these days, but there are common browser bugs with using rems or ems in media query rules, so in the rules specifically it is common to still specify pixels, even if the rest of your stylesheet uses rems or ems.
- Freak_NL 6y agoAlso the magnificent rem (root em) unit.
- franga2000 6y agoI think that's referring to screen width. As in, breakpoint for when screen witdth is >= 1536px and as screens use pixels, that is the only unit talking about screens is reasonable in. em/rem/whatever don't make sense in media queries.
- mixmastamyk 6y agoI see, thanks y'all.
- harrygeez 6y agopx is still easier and more convenient to reason with, plus it's more readable. I use px in my code but I also use a postcss plugin to convert them to rem during build time
- minitech 6y agoPixels have always had their uses, but I moved from em to pixels even for sizes that would ideally scale with text in order to be able to get things to align to whole vertical pixels (and horizontal ones, when not centered).