DigitalRiver / react-atlas

Composable React components with CSS Modules.
http://digitalriver.github.io/react-atlas/
MIT License
38 stars 25 forks source link

Styles are loaded twice. #909

Closed hbowden closed 5 years ago

hbowden commented 5 years ago

The index.js currently has styles embedded so if a user imports our stylesheet like we tell them to in the documentation and import components via import { Button } from 'react-atlas'; then styles will be loaded twice once via the style tag in the index.js and once by the stylesheet.

stuller commented 5 years ago

So what is the solution? To not include them, or to update documentation so we aren't telling them to also include?

hbowden commented 5 years ago

@stuller I changed the style-loader to extract the css out of the index.js file and then added the second css file to npm ignore and gitignore so its not included in builds and the repo. This should fix the problem but it's kind of a hack, but should work for now. I'll have a pr for this issue and this issue: https://github.com/DigitalRiver/react-atlas/issues/907 pretty soon.

hbowden commented 5 years ago

There's a couple "better ways" but they would take more effort so I was thinking this so we can focus on checkout.