chenglou / react-spinner

Zero configuration loading spinner.
186 stars 36 forks source link

Make the styles inline with the component #17

Open dwilt opened 8 years ago

dwilt commented 8 years ago

One of the beautiful things about the React ecosystem is how well it plays with things like Webpack. It would be great if I could just import the component and have the styles inlined for me.

esamattis commented 8 years ago

Yup. But there's no need to port to inline styles. The component could just inject a style-tag on demand with https://github.com/substack/insert-css for example.

tobia commented 7 years ago

Shouldn't this component import its own styles?

import './react-spinner.css'

Anyways, for anyone having trouble, just import the styles alongside the module:

import Spinner from 'react-spinner';
import 'react-spinner/react-spinner.css';