-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add system-ui to the normalized font-family list #1326
Conversation
https://caniuse.com/#feat=font-family-system-ui if a browser supports system-ui, it'll choose the best font and won't cascade through the fallback list. this protects tailwind from it's static list not being as up to date with platforms fonts as time goes on.
I see the tests are failing! The tests don't match the change, awesome! Did I add |
As far as I can see, your change is in the source files, but the tests compile the source and check whether the result is the same as |
We deliberately don't include it currently because of this issue, which bit Bootstrap when they tried to include it: https://infinnie.github.io/blog/2017/systemui.html Thoughts? |
I've got some thoughts yeah! But, I like that you're aware of why you're managing the string list instead of using The article's tldr is that China, in a windows machine, will use the system Chinese font which isn't as great as Segoe. It's pretty much a full stop there, though one could argue Japan can run into a similar scenario. "isn't that great" can also be worded as, "the font they look at all day in that operating system." IMO, the tradeoff of never needing to manage a system font cascading string set vs managing a system font cascading string set (which is crazy hard to test and verify is giving you what you want, it's like a matrix of ui tests you'd have to run), it's pretty obvious to me which I'd pick, the future proofed system-ui keyword. It'll get better with every browser release, etc. I mean, now we have Edgium, and I'm sure they've been picky in their font choices. The post isn't wrong, the post is nitting some super edge cases stuff, which is awesome because the web should be rad and great for everyone, but I'm not sure that the scenario presented in that post is compelling enough to tradeoff all the other benefits. Maybe 3 years ago the tradeoff was worth it, but not today. There's this to note as well w3c/csswg-drafts#3658, where folks are tracking and talking about the issue presented in that blog post. There's a related chromium bug too, but it's a funny one. Not everyone agrees with the blog post, not everyone wants Segoe when "i want the system font" is specified in their CSS. Hehe, sorry for the essay! This has been very fun to research, thanks for the swift feedback. |
Can you think of a benefit to including this a the front of the stack if we have to maintain the string list in the mean time for Firefox anyways? |
Never having to update the string again? 🤷♂ |
Yeah fair enough, let's add it and hopefully we can delete the other cruft in a decade or two 😅 |
https://caniuse.com/#feat=font-family-system-ui
I believe adding this future proofs the static list and supports the intent of using the platform system font more specifically.
If a browser supports system-ui, it'll choose the best font and won't cascade through the fallback list. This protects tailwind from its static list not being as up to date with platforms fonts as time goes on.
👍