19

What's the difference between ui-sans-serif and sans-serif fonts in font-family in CSS? And ui-serif vs. serif? And ui-monospace vs. monospace?

Where does system-ui fit into this? Would you use it for all 3 types of fonts, and where would it go in the list of fonts?

I usually see the "ui-" variant coming first in the list of fonts in font-family in CSS, and the other coming last. Something like font-family: ui-sans-serif, (more fonts here), sans-serif. What's the point in doing that if the first matched font will be used? Since ui-sans-serif is a generic font, won't it always be matched and there's no need to add any fonts after it?

1 Answer 1

18

ui- generics should map to the default fonts of the system while non ui- generic ones map to the default of the browser.

A web-browser may have the same default font set for all platforms, however different platforms do have different default fonts.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.