Menu

I doubled the root font size on all 76 of our pages and 60 per cent of the text did not move
📰

I doubled the root font size on all 76 of our pages and 60 per cent of the text did not move

DEV Community: css·Daniel Pertu·about 22 hours ago
#k9vhlJz6
#devtocss#devto#dev#size#font
Reading 0:00
15s threshold

Browser zoom is not the only way readers make text bigger. Chrome, Firefox and Safari all have a font size setting, and it works differently from zoom: instead of scaling the whole layout, it changes the default font size that rem and em resolve against. Text declared in those units grows. Text declared in pixels does not.

So "we pass zoom" and "we respect the reader's font size" are two different claims, and only the first one is easy. I measured the second on all 76 public pages of Nakodo by doing to each page what the setting does to rem :

const style = document . createElement ( "style" ) ; style . textContent = "html{font-size:32px !important}" ; // double the default 16px document . head .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.