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

set font-display: swap as default #148

Closed
HereChen opened this issue Aug 30, 2019 · 4 comments
Closed

set font-display: swap as default #148

HereChen opened this issue Aug 30, 2019 · 4 comments
Assignees

Comments

@HereChen
Copy link

Font loading has a performance issue. And set font-display: swap is not possible with CDN.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/tufte.min.css">

image

Is it possible to set font-display: swap as default?

@font-face {
     ...
+    font-display: swap;
}

see also Suggestion: Implement font-display, Ensure text remains visible during webfont loads.

@HereChen HereChen changed the title set font-display: swap by default set font-display: swap as default Aug 30, 2019
@daveliepmann
Copy link
Contributor

How would this change affect browsers that don't support this feature?

@HereChen
Copy link
Author

HereChen commented Sep 2, 2019

@daveliepmann

This change has no effects on browsers that don't support it.

So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents must not selectively ignore unsupported property values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored. Partial Implementations

https://css-tricks.com applied this feature even though IE 11 does not support font-display.

image

This article font-display for the Masses may help you understand the problems font-display solved.

@daveliepmann daveliepmann self-assigned this Sep 2, 2019
@daveliepmann
Copy link
Contributor

See #119 for prior report.

@daveliepmann
Copy link
Contributor

Thanks for the recommendation; we're trying it out.

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

No branches or pull requests

2 participants