News for hackers. Stuff that matters.
Re:PX or REM in CSS? Just Use REM by jacobp100 on Saturday December 03, 2022 @03:28PM (#33846981)
It’s odd how they seemed to know the difference between browser zoom and font size settings, but came to that conclusion

You should only use the unit that scales with the font size setting for font size related properties. That’s font-size, line-height, and letter spacing

Re:PX or REM in CSS? Just Use REM by shortcake27 on Saturday December 03, 2022 @04:04PM (#33847350)
Yeah this. Directly scaling margin and padding with font size causes an accessibility _problem_ because the UI becomes unusable after a couple of steps, especially on mobile.

If every unit scales with font size then you’ve basically invented zoom, which browsers already have.

Dynamic Type on iOS is the perfect example. I have bad eyesight so I bump up the text size. This only affects the font size. It doesn’t scale the entire UI.