-
Notifications
You must be signed in to change notification settings - Fork 682
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
[css-fonts] is it allowed for generic families like system-ui to be overridden by @font-face? #4580
Comments
No, it can't. See https://drafts.csswg.org/css-fonts-4/#family-name-syntax for the details - that @font-face is totally valid, and |
I understand that if you want to refer to a font that just happens to have the same name of generic-family keywords, you should use double quotes to distinguish. But the question is more about are you able to (deliberately) override generic families? Thanks. |
No, sorry, I was referring to the property, like In the @font-face 'font-family' declaration, it doesn't matter whether it's quoted or not; they do exactly the same thing. But in the property on an element, keywords always refer to the generic family, and strings always refer to the webfont. |
Thanks for cleaning that part up, but the question remains: Should you be able to (deliberately) override generic family keywords using Consider the following use case: Remote (website) delivers a "bad font" in CSS rule property: @font-face {
font-family: badFont;
src: local("goodFont");
} Now, if the remote delivers system-ui Note: I'm not trying to ask we change the spec to help on that, simply that the spec currently reads to me that is not disallowed to override generic keywords. if someone can help directly quote the sentence(s) in spec that says or implies "generic keywords can't be overridden", it would clear up the whole thing. |
No
The @font-face The
Some UAs (e.g. Firefox) allow the user to choose what font maps to the generic keywords. If you want that functionality in your UA and it doesn't provide it, file a bug. |
From the spec chapter I linked to in my original comment:
This text is very clear that if you say |
Thanks for the replies, you two are very helpful. I think now I understand.
The mapping in Firefox is kind of tricky (for example, kanas in mixed content with locale of en will be mapped to Chinese fonts if Chinese has higher priority than Japanese, instead of always using Japanese fonts), but I will leave this topic somewhere else. I do agree it's more controllable than Chrome in some cases. |
@kojiishi and I had a discussion about this topic in https://crbug.com/1021568.
The core question is, should the following css rule
override the generic font family of
system-ui
withArial
?I've read chapters about generic font families and font-face multiple times, but can't get a clear answer.
Thanks!
The text was updated successfully, but these errors were encountered: