Skip to content

Conversation

@robbertkl
Copy link
Contributor

@robbertkl robbertkl commented May 5, 2020

Hi! This change extends the current font stack for both sans-serif and serif with new "standard font families". Please see: https://www.w3.org/TR/css-fonts-4/#ui-serif-def

For the default font and font-sans class/variants this won't have much effect for now, since system-ui and -apple-system are already included. For font-serifand font-mono it now includes ui-serif / ui-monospace, for which support from Safari landed just last month with Safari 13.1.

To summarize the change:

  • The sans-serif font stack is prepended with ui-sans-serif, which makes it:
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"
  • The serif font stack is prepended with ui-serif, which makes it:
ui-serif, Georgia, Cambria, "Times New Roman", Times, serif
  • The monospace font stack is prepended with ui-monospace, which makes it:
ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace

Thanks and keep up the good work! Tailwind CSS is awesome 🚀

@jhauraw
Copy link

jhauraw commented May 7, 2020

Maybe ui-mono too?

@robbertkl
Copy link
Contributor Author

Good catch, that should definitely be included as well 😄.

Will add it later today.

@robbertkl
Copy link
Contributor Author

Maybe ui-mono too?

It's actually ui-monospace.

So I've now added ui-monospace to the mono font stack and also decided to drop -apple-system-ui-serif (and not add -apple-system-ui-monospace) since they were never a main part of Safari. So now this PR is just about adding ui-sans-serif, ui-serif and ui-monospace to the respective font-family classes. I'll edit the PR description accordingly.

@adamwathan
Copy link
Member

Merged manually to resolve conflicts, not sure why GitHub doesn't pick it up :/ 2c6f237

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants