In tailwind.config.js, I moved existing entry 'Roboto' to the top of sans entry like this:
fontFamily section at tailwind.config.js
fontFamily: {
sans: [
'Roboto', /*we should now use Roboto when displaying font-sans class*/
'system-ui',
...
'"Segoe UI"',
/*'Roboto', - moved from here to the top*/
...
],
serif: ['Georgia', 'Cambria', ...],
},
I made sure that TailwindCSS picks the first entry from fontFamily when evaluating font-* entries. I tried swapping serif fonts Georgia and Cambria.
Either your font files are not being found, due to incorrect paths or you should check you’re using quotes in your tailwind config like “Roboto”, Instead of Roboto,
downloaded and extracted roboto-v20-latin.zip to assests/fonts
copied bunch of @font-face statements to styles/common/_fonts.scss
added @import "common/fonts"; to styles/main.scss
built my site again, my texts are displayed with Roboto as expected
Files:
main.scss
/**
* This injects Tailwind's base styles, which is a combination of
* Normalize.css and some additional base styles.
*/
@tailwind base;
/** Import fonts */
@import "common/fonts";
...