I'm building a Chrome Extension with react-redux, and I want to inject CSS globally with logic.
I trying to do this by making a component import a global CSS file, but it's not working.
styler.js
import React, { Component } from 'react';
require('./styler.css');
class Styler extends Component {
render(){
return (
<div />
)
}
}
export default Styler;
styler.css
:global(.myclass) {
background-color: red;
}
I just get an import error. Is there a way for a react project (or component) to inject CSS globally?