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

Fonts: Use fontsource package for loading fonts #1098

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Blendify
Copy link
Member

fontsource is the new defacto source for google fonts.
Originally, this was typeface-* however that is now deprecated.
Not sure why but there does not seem to be woff2 formats for the all character sets.
But the new fonts are already smaller than the old woff2 as we now only include the needed font weight.

fontsource is the new defacto source for google fonts.
Originally, this was `typeface-*` however that is now deprecated.
Not sure why but there does not seem to be woff2 formats for the `all` character sets.
But the new fonts are already smaller than the old woff2 as we now only include the needed font weight.
@Blendify Blendify requested review from a team March 20, 2021 14:45
@Blendify Blendify added this to the 2.0 milestone Mar 23, 2021
@ayuhito
Copy link

ayuhito commented Mar 23, 2021

The ‘all’ subset only exists for woff only to support older browsers where smaller file sizes are a less of a concern. Older browsers don’t have the unicode-range selector and thus it isn’t possible for the browser to detect what’s needed, hence everything is served.

For newer browsers that support the unicode-range selector, everything is split up to ensure your browser only downloads what’s needed based on the content of the webpage.

I wouldn’t recommend to only import the woff files and instead directly import the css or use the fontFace Sass mixin which accounts for the best of both worlds.

@Blendify
Copy link
Member Author

Thanks for the explanation, we may want to wait until an issue with the fontFace mixin is fixed, see fontsource/fontsource#153

@Blendify Blendify added the Status: blocked Issue is blocked on another issue label Mar 23, 2021
@Blendify Blendify marked this pull request as draft March 23, 2021 17:04
@ayuhito
Copy link

ayuhito commented Mar 24, 2021

The documentation on the main repo README states the new method to import fonts using the @use Sass command. I would recommend using that and forget about default variables for now since I'm not sure how that will pan out.

@Blendify
Copy link
Member Author

Will still use node sass and as far as I know those statements are not supported. I made a patch to switch to dart sass but I don't think it is worth it until we can remove wyrm and bourbon which depend on node sass.

sass/node-sass#2886

@Blendify Blendify modified the milestones: 2.0, 3.0 Mar 29, 2021
@humitos humitos modified the milestones: 3.0, 3.1 Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: blocked Issue is blocked on another issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants