pimp-my-book / umqombothi-component-library

PMB Plus - React Component Library 🍶
https://umqombothi.netlify.com
2 stars 2 forks source link

Font's not loading #33

Open AmoDinho opened 4 years ago

AmoDinho commented 4 years ago

Fonts are not loading when the lib is imported

AmoDinho commented 4 years ago

So it appears that the CSS is importing the fonts but it is not loading.

AmoDinho commented 4 years ago

Stuff about blunders: https://www.freecodecamp.org/news/anatomy-of-js-module-systems-and-building-libraries-fadcd8dbd0e/

https://stuartsandine.com/js-bundle-across-envs/

https://www.sitepoint.com/javascript-modules-bundling-transpiling/

https://unpkg.com/

AmoDinho commented 4 years ago

Hi folks, I've got a component library in React that is not rendering a pair of fonts from Google.

This is how I'm declaring them in my CSS:

  @font-face {
    font-family: 'Kanit', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Kanit Regular'), local('Kanit-Regular'), url(https://fonts.gstatic.com/s/kanit/v5/nKKZ-Go6G5tXcraVGwA.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }

  @font-face {
    font-family: 'Rubik Mono One', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Rubik Mono One Regular'), local('RubikMonoOne-Regular'), url(https://fonts.gstatic.com/s/rubikmonoone/v8/UqyJK8kPP3hjw6ANTdfRk9YSN983TKU.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }

Interestingly enough it shows that it is rendering the font in DevTools but nothing is showing up:

dev_tools