4 ms·
This method uses the root font size as the base and therefore scales with the user's custom setting.
by stefanfisk 3y ago
This method uses the root font size as the base and therefore scales with the user's custom setting.
- deleted 3y ago[deleted]
- Karellen 3y agoThe point of the user's custom setting is that you don't need to scale with it. The user's custom setting is the font size they want! That's why they set it. If the user wants a different root font size, they'll set it themselves.
- bryanrasmussen 3y agofont size needs to scale because font size can also affect contrast, unless the user is setting custom font size per site it will not be adequate for the user to set the custom font size for all potential situations.
- p_l 3y agoUnfortunately, while making a site, I can't query for "does the user set special preferences" in CSS. I use somewhat similar formula in one project to create a common baseline font size that 1) does not break with viewport size changes 2) remain legible for baseline user 3) gives good base value to scale UI elements by rem/em units. Of course it's also a project where the user does not have a chance to mess with font size anyway for the main user, but I'd reuse the formula elsewhere. Wish I could query the browser if the user has specific preferences, just like with "Dark mode"
- persnickety 3y agoYou don't query for it; you don't override. Either the setting is custom and desired, or it's default and it hasn't been adjusted because it's fine.
- p_l 3y agoMy personal experience is that the default is usually wrong, especially when I move between different displays. I end manually zooming in/zooming out a lot. Meanwhile using the default size + CSS keyword size modifiers (large/x-large etc.) ended up on breaking on the project I mentioned, especially after for all practical purposes we had to deal with the fact that claims of single display size & resolution to target weren't actually delivered, and when client also asked about possibly opening the interface from portable devices.
- persnickety 3y agoSadly, I agree that browsers have forgotten what defaults are for. Instead of prvoiding something useable for the user, default CSS has turned into a nearly completely abstract set of values of relevance only to developers. But that situation should be fixed on the side of the Web browsers, not every website's author.
- account42 3y ago> My personal experience is that the default is usually wrong, especially when I move between different displays. I end manually zooming in/zooming out a lot. Then fix your setup. Campaing for better browser defaults. Do whatever it takes, but don't add hacks with hardcoded (=faulty) assumptions to your websites.
- mcherm 3y agoOR, the setting is default and it hasn't been adjusted because the user doesn't have the faintest idea how to adjust font sizes. Which I suspect is the case for the majority of end users.
- account42 3y agoThe responsibility for making sure the default is reasonable for those users is the browser vendor, NOT each individual website.
- account42 3y ago> Wish I could query the browser if the user has specific preferences, just like with "Dark mode" You can't query that with dark mode since there is no "no-preference" in the spec and the "preference" that browsers expose normally has not been influenced by the user in anyway. You should still respect the indicated dark mode preference because the user can influence it to set their preference for all sites. Same with the font size.
- tiagod 3y agoThe vast majority of users don't know how to adjust the font-size.
- Karellen 3y agoIs that just because they've never tried to figure out how, because the default font size works fine for them? In which case, the answer is still not to change it.
- jrwoodruff 3y agoIf every site used the same font, maybe. But different font faces vary in readability at the same size. Also, we still have to set sizes for things like titles, subtitles and other elements to create a hierarchy on the page. 'Don't resize my fonts' is such a narrow view of whole range of design considerations.