5 ms·
Why isn't `sans-serif` just the default sans-serif font? Why do we need a new keyword to get the actual default font?
by kevincox 4y ago
Why isn't `sans-serif` just the default sans-serif font? Why do we need a new keyword to get the actual default font?
- TacticalCoder 4y agoThat's kinda the point of these font stacks right!? You want to fall back to the default sans-serif font only if you didn't some better font first.
- aaaaaaaaaaab 4y agoBetter? Better than the default? So… you think your font of choice would be better than what the user had configured as the default in their user agent?
- kevincox 4y agoThat's not how I see it. I see it as not trusting that the default is good looking so we'll list a bunch of good-looking fonts with the hope that we get a hit and the browser doesn't use an ugly default.
- hit8run 4y agoHighly underrated comment.
- SenHeng 4y agoBecause whatever is default depends on too many variables. Like if you're on a Japanese OS but your language preferences are English, the default sans-serif font is a Japanese typeface that often doesn't display Roman alphabets that nicely.
- thrdbndndn 4y ago> Like if you're on a Japanese OS but your language preferences are English, the default sans-serif font is a Japanese typeface Please specify your environment. I use Japanese OS and I haven't found a single OS/browser combo would do that. Use Windows as an example, sans-serif by default = Arial for Chrome and Firefox for English content. And as a bonus, you can even adjust the default sans-serif font in browser setting to your like; while with these hard-coded CSS, you can't.
- SenHeng 4y agoMacOS Monterey, default system language is Japanese but obviously I browse a lot of English websites. Using plain sans-serif, I get Hiragino Kaku Gothic ProN as my default font instead of something nice like Helvetica Neue.
- thrdbndndn 4y agoDo you mean lang:ja or lang:en content? Because I feel like the former is meant to have Japanese fonts even for Latin glyphs for consistency's sake, but I understand that some people do prefer the other way. And indeed, MacOS system font by default is like that. Windows is the opposite, though (everything is in Meiryo UI or whatever it's now called.) (Not sure if it's changed in Win11 either.)
- zinekeller 4y ago> Do you mean lang:ja or lang:en content? Not the OP, but I'm sure it's webpages that don't have the lang attribute at all, which is why macOS used the Japanese font stack instead of the English one.
- divbzero 4y agoI wish browsers chose better default fonts which would make monospace, sans-serif, and serif more appealing. As an alternative, adopting new CSS keywords like user-monospace, user-sans-serif, user-serif could allow web developers to prioritize user-configured fonts in the browser.
- tshaddox 4y agoFor backwards compatibility, most likely. If sans-serif on a particular platform has been FontX for 25 years browser vendors probably don’t want to suddenly change it for all existing websites.
- kevincox 4y agoAll I hear is that we have a chance to improve websites that have been ugly for the past 25 years because of bad browser defaults.
- netheril96 4y agoAnd break a lot of websites whose layout is tightly coupled to the details of font sizes.
- janc_ 4y agoThose sites have always been broken for a lot of people, so this would only break them for a different group of people…
- dspillett 4y agoIt is the browser's default sans-serif font. This may not align with the OS's default interface font.