I'm using React, Redux, styled components and GitHub pages with my app.
Global styles work in development, but do not get applied after deploying to GitHub pages.
e.g. in App.js
import { createGlobalStyle } from 'styled-components';
const GlobalStyle = createGlobalStyle`
body {
@import url("https://fonts.googleapis.com/css?family=Quicksand");
color: red;
}
`
const App = () => (
<React.Fragment>
<GlobalStyle />
<Provider store={store}>
<Router>
<div>
//REST OF APP
</div>
</Router>
</Provider>
</React.Fragment>
);
export default App;
The problem lies in the fact that there is currently an issue when using @import in Global Styles. The solution is to take the @import out and place it elsewhere, such as in a link tag, if you're using Google fonts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With