-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Description
It's time to add:
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif
This solution is harmless and very useful.
It is used by GitHub, Wordpress, Bootstrap, Medium, Ghost, etc.
The main reason for using "system" fonts is performance. Fonts are typically one of the largest/heaviest resources loaded on a website. If we can use a font already available on the user’s machine, we can completely eliminate the need to fetch this resource, making load times noticeably faster.
The beauty of system fonts is that it matches what the current OS uses, so it can be a comfortable look.
-apple-system
targetsSan Francisco
in Safari (on Mac OS X and iOS), and it targetsNeue Helvetica
andLucida Grande
on older versions of Mac OS X. It properly selects betweenSan Francisco Text
andSan Francisco Display
depending on the text’s size.system-ui
represents the default UI font on a given platform.BlinkMacSystemFont
is the equivalent for Chrome on Mac OS X.Segoe UI
targets Windows and Windows Phone.Roboto
targets Android and newer Chrome OS. It is deliberately listed afterSegoe UI
so that if you’re an Android developer on Windows and haveRoboto
installed,Segoe UI
will be used instead.
The bottom line: It's truly the ultimate solution for any website/webapp in any OS.
DoronBrayer, dpmango, hdl-helsinki, abodacs, sashabeep and 331 morekevinvanrijn, russmaxdesign, battaglr, Toddses, vforge and 16 morejosias2dev, hemanthtejadasari, yaserotb, jpomykala, mblackritter and 1 moreJesseXia, rizwankukad, 12finger, Omid888, felipelincoln and 10 morejosias2dev and Xabi1111adityavikasd, IsenrichO, LapysDev, JesseXia, rizwankukad and 32 moresercanpaspal, raizenxd, 12finger, claudiobonfati, qrobin and 16 morejosias2dev, mblackritter, JohnChristianD and foxling
Activity
kevinvanrijn commentedon Apr 3, 2017
Didn't normalize.css just get rid of opinionated defaults? I don't see how this would be less opinionated then the old
font-family: sans-serif;
rule.russmaxdesign commentedon Apr 3, 2017
This is opinionated. See this thread #664
DoronBrayer commentedon Apr 3, 2017
Using system fonts is not "opinionated".
System fonts are just system fonts.
If you insist, use:
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto
[Removing the"Helvetica Neue",Arial,sans-serif
part]This is normalization, not reset.
Again- this solution is used by GitHub, Wordpress, Bootstrap, Medium, Ghost, etc.
miquelfire commentedon Apr 3, 2017
What browser is using ANY of these fonts by default?
DoronBrayer commentedon Apr 3, 2017
Read:
Font stack in 2017
thierryk commentedon Apr 3, 2017
@DoronBrayer that does not answer @miquelfire's question:
Normalize relates to default styling and—as far as I know—browsers do not use system fonts out-of-the-box.
DoronBrayer commentedon Apr 4, 2017
If 99% of the websites uses
sans-serif
as default, why go with the other 1%?! - Go with the majority, go with the 99%!In addition -
sans-serif
is used by any framework out there, and there's a reason for that.Not setting a
font-family
(inbody
orhtml
) is so 2007.It's time to move on, really.
jonathantneal commentedon Apr 11, 2017
@DoronBrayer, I get what you are saying, but what you are describing is less the use case for bugs and common browser inconsistencies and more the use case for common developer expectations and preferences, like
box-sizing: border-box
, etc..At least one project needs to hold the fort so to speak so that there may be a reliable base for your own projects, or bootstrap, or sanitize.css, etc.
bardiharborow commentedon May 14, 2017
Noting for further reference, that we've had to back out
system-ui
over at Bootstrap due to a number of issues with faulty Chinese fonts on Windows.mvasilkov commentedon Oct 15, 2017
Since this feature isn't going to be added here, a shameless plug: https://github.com/mvasilkov/systematize
It's basically normalize.css with some improvements to typography, coming from this repo's pull requests mostly. WIP.
26 remaining items
Revert "fish_config: use system-ui/sans serif for non-shell/code text"
jeffatoptics commentedon May 3, 2022
put "Segoe UI Emoji" before "Segoe UI Symbol". otherwise, chrome/edge in windows will only display the emoji in white/black color.
tedw commentedon May 3, 2022
FWIW here’s the current CSS I’m using to normalize emojis:
Then you can append
color-emoji
to the end of your font stack:emoji
generic font-family system-fonts/modern-font-stacks#7HNazmul-IV commentedon Jul 30, 2023
But My question is How a font become heaviest , largest, painful resource for a website ? ?
PaperMod: Fix problematic emoji rendering in Chrome
PaperMod: Standardise emoji appearance across platforms
deno.land/x/
denoland/website_feedback#62ticoeteco23gb commentedon Jul 26, 2024
There are many glyphs in a font for each character, those glyphs are basically vector graphics united together. A typeface has multiple styles of glyphs... Yeah, it depends on how complex the font is.