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

feat(fonts): add google font support via flag #10393

Merged
merged 7 commits into from
Jan 14, 2022

Conversation

tw15egan
Copy link
Member

Closes #10353

Adds in out-of-the-box support for Google fonts by enabling the $use-google-fonts flag. It has been turned on by default for testing purposes.

If turned on, it will create the src field from google data, rather than resolve to the installed plex package.

Changelog

New

  • $use-google-fonts flag, which if enabled will provide font files directly from the Google static server rather than the @ibm/plex package itself.
  • Map of all the google data in @styles/scss/fonts/_src.scss

Testing / Reviewing

First, navigate to the IBM Plex story in the carbon-react storybook. Then, in dev tools, go to the Network tab, hit record, and do a hard refresh. The woff files should resolve to Google servers. If testing locally, flip the flag to false and see that the path is now set to the locally installed font files.

Before merging the flag should be set to false by default.

@tw15egan tw15egan requested a review from a team as a code owner January 12, 2022 17:32
@netlify
Copy link

netlify bot commented Jan 12, 2022

✔️ Deploy Preview for carbon-react-next ready!

🔨 Explore the source changes: 0b54c93

🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-react-next/deploys/61e1bf09f6e411000736af4c

😎 Browse the preview: https://deploy-preview-10393--carbon-react-next.netlify.app

@netlify
Copy link

netlify bot commented Jan 12, 2022

✔️ Deploy Preview for carbon-elements ready!

🔨 Explore the source changes: 0b54c93

🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/61e1bf09eb25010008c78ba4

😎 Browse the preview: https://deploy-preview-10393--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Jan 12, 2022

✔️ Deploy Preview for carbon-components-react ready!
Built without sensitive environment variables

🔨 Explore the source changes: 0b54c93

🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/61e1bf09d273f50008cdbee8

😎 Browse the preview: https://deploy-preview-10393--carbon-components-react.netlify.app

Copy link
Contributor

@abbeyhrt abbeyhrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Pulls in fonts from google as expected 👍

@jnm2377
Copy link
Contributor

jnm2377 commented Jan 14, 2022

🔥 great work on this!

@kodiakhq kodiakhq bot merged commit 69547cd into carbon-design-system:main Jan 14, 2022
@tw15egan tw15egan deleted the google-fonts branch March 3, 2022 16:14
kennylam pushed a commit to kennylam/carbon that referenced this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for hosted option through Google Fonts
3 participants