3 ms·
Counterpoint: rem is a PITA for small coding projects unless you don't care about design or love doing math all of the time. rem was important 10+ years ago fo
by legitster 3y ago
Counterpoint: rem is a PITA for small coding projects unless you don't care about design or love doing math all of the time.
rem was important 10+ years ago for accessibility, before responsive frameworks and browser accessibility tools made it more or less redundant. When we have done accessibility testing, we found that almost no users actually bother with adjusting text size via their browser - the majority either use the MUCH easier to find zoom tools (which work great with px based sizing), or simply turn down the resolution of the display.
So much of the text display is now controlled by the browser (especially on mobile!) that for most situations it doesn't matter what unit you use - the browser will interpret it for you and use whatever number of pixels it determines is best).
I would consider rem to be a legacy accessibility feature - it's probably fine to use pixels in 2023.
- TheRealPomax 3y ago>The browser will interpret it for you and use whatever number of pixels it determines is best). Until you zoom Mobile browsers might zoom the content as if it's an image, scaling the entire viewport, but desktop browsers very much do not. Plus, working in rem instead of px is super easy, barely an inconvenience. And now it works on both mobile and desktop. Amazing.
- legitster 3y ago> Mobile browsers might zoom the content as if it's an image, scaling the entire viewport, but desktop browsers very much do not. What browser are you using? If you zoom up this very HN page in Chrome or Firefox it will grow the content without spilling over the readable area. This works just as well with pixels as it does with rem.
- simlevesque 3y ago> rem is a PITA for small coding projects unless you don't care about design or love doing math all of the time. I've never found the rem made it harder to care about design.
- legitster 3y agoDepends on what you are working on. Sometimes you will work with designers who need text and on-page elements to line up in certain ways or provide a certain amount of interactivity. In those cases REM can be a huge pain when you have to design everything in relation to everything else rather than just be able to pull over the design verbatim.