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

Add local() argument to _fonts.scss #59

Open
stephiescastle opened this issue Nov 17, 2021 · 1 comment
Open

Add local() argument to _fonts.scss #59

stephiescastle opened this issue Nov 17, 2021 · 1 comment

Comments

@stephiescastle
Copy link
Member

stephiescastle commented Nov 17, 2021

As seen in https://github.com/nasa-jpl/www-frontend/pull/1190/files, we should add a local() argument to our src attributes in _fonts.scss:

@font-face {
  font-family: Metropolis;
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: local(Metropolis-ExtraBold), local(Metropolis ExtraBold),
   url(../fonts/metropolis/Metropolis-ExtraBold.woff2);
}
...

url() is recommended as a fallback
https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face

If the local() function is provided, specifying a font name to look for on the user's computer, and the user agent finds a match, that local font is used. Otherwise, the font resource specified using the url() function is downloaded and used.

@Morsey187
Copy link

Might be best to update font-display to optional if tackling this issue.
https://github.com/nasa-jpl/www-frontend/issues/1178#issuecomment-971968192

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

2 participants