typestyle / typestyle

Making CSS Typesafe 🌹

Home Page:https://typestyle.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[question] Loading multiple font files

remotealex opened this issue · comments

I'm trying to load fallback urls for my web fonts. Doing it the normal css way broke them:

fontFace({
  ...
  src:
    "url(/static/fonts/SofiaProSemiBold.woff2) format('woff2'), url(/static/fonts/SofiaProSemiBold.woff) format('woff')",
});

Should I break them up into two fontFace calls?

  • quote the url strings
  • check with browser dev tools what is generated, you will probably see the error.