Skip to content
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

Provide a safer and future-proofed system font stack #353

Merged
merged 1 commit into from
Jan 15, 2018
Merged

Provide a safer and future-proofed system font stack #353

merged 1 commit into from
Jan 15, 2018

Conversation

nternetinspired
Copy link
Contributor

Hey guys!

This PR brings two discrete additions:

  1. By transposing system-ui and BlinkMacSystemFont keywords, it eliminates the potential for issue which may occur if the font-stack were used in a shorthand declaration, as that causes IE and Edge to choke at -apple-system and ignore the entire declaration. See Implementing system fonts on Booking.com — A lesson learned for full details.

  2. Future proofs the stack by adding support for the newer, unprefixed, SystemUI font-family keyword that was introduced with Chrome 56 with the aim of providing a standard, cross-browser implementation.

Thanks for your consideration.

Absolutely loving Tailwind so far, keep up the great work!

@nternetinspired nternetinspired changed the title [Fixed] Provide a safer and future-proofed system font stack Provide a safer and future-proofed system font stack Jan 11, 2018
@sgraewe
Copy link

sgraewe commented Jan 12, 2018

system-ui is not supported in IE11 and Edge

https://caniuse.com/#search=system-ui

@nternetinspired
Copy link
Contributor Author

Correct @sgraewe but thats's kinda irrelevant, and why it's sensible to declare a font stack rather than a single family in the first place; a browser that doesn't understand it will just skip it and move on to the next one.

It's perfectly valid stack declaration, and causes no issues, for either Edge or IE;

screen shot 2018-01-13 at 16 48 05

The only issues with using such a stack in IE is with using the -apple-system keyword first, the issue that this PR will resolve by transposing the keywords, as described above.

@adamwathan
Copy link
Member

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