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

Create a proper Critical FOFT with preload (polyfill) for Variable Fonts #7

Open
ghost opened this issue Jul 2, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 2, 2019

The last time you wrote about Variable Fonts was just over two years ago and a lot has changed since then.

Is it possible to create a proper "Critical FOFT with preload (polyfill) for Variable Fonts" example, with Fallback fonts.

Thanks.

@ghost
Copy link
Author

ghost commented Jul 2, 2019

Here's an example of a Variable font setup with a fallback, you could merge with your script:

/* Load the variable font */
@font-face {
	font-family: 'Venn VF';
	src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/814870/Venn_VF.woff2') format('woff2-variations'), /* for Safari */
			 url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/814870/Venn_VF.woff2') format('woff2'); /* for all other supporting browsers */
	font-display: fallback;
	font-weight: 300 800; /* prevents faux bolding in Safari */
	font-stretch: 75 125;
}

/* Load the static fonts as a fallback */
@font-face {
	font-family: 'Venn';
	src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/814870/Venn_Regular.woff2') format('woff2');
	font-display: fallback; /* has nothing to do with the fact that this is the fallback font */
}

@font-face {
	font-family: 'Venn';
	src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/814870/Venn_Bold.woff2') format('woff2');
	font-display: fallback; /* has nothing to do with the fact that this is the fallback font */
	font-weight: 700;
}

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

No branches or pull requests

0 participants