combine / universal-react-redux

🧐 A sensible universal starter kit for React + Redux
110 stars 18 forks source link

Including fonts in base _fonts.scss #49

Closed just2jays closed 6 years ago

just2jays commented 6 years ago

I'm unable to use the Google fonts via @import in the ./common/css/base/_fonts.scss partial.

It seems as if the @import statement is being rendered rather than the contents of the font url request.

For instance, if I clone this repo and simply add another Font import underneath the included "Open Sans" @import url('https://fonts.googleapis.com/css?family=Roboto'); - I'm unable to reference this Roboto font.

Am I missing a step here?! Thanks for any help.

calvinl commented 6 years ago

@just2jays Good catch!

It looks like it's a precedence issue in this line of code here. Basically, webpack is compiling css modules since App is imported before the styles file is.

Try moving the styles import to line 2, and it should fix the issue.

e.g.

import 'babel-polyfill';
import './styles';
// ...