create-react-library icon indicating copy to clipboard operation
create-react-library copied to clipboard

How to add `index.css` implicitly without having to import it manually in react-app?

Open WhoAdarshPandya opened this issue 4 years ago • 1 comments

hello, i'm working on component library which can be lookalike of material-ui , everything works fine except that i have to import css explicitly on every project

it's like

import App from './App'
import {Button} from 'fusion'
import 'fusion/dist/index.css'

ReactDOM.render(<App />, document.getElementById('root'))

what i want is: (directly import components without importing css)

import App from './App'
import {Button} from 'fusion'

ReactDOM.render(<App />, document.getElementById('root'))

WhoAdarshPandya avatar Mar 13 '21 09:03 WhoAdarshPandya

You should use a css-in-js approach

damjtoh avatar Apr 07 '21 16:04 damjtoh