Reputation: 1033
I have a component which I use all over my application, but it's style may somehow differ. Before I did not reuse this component, and was able to import scss file, knowing a path to it. Now I want to make it reusable and want to make it aware of styles that go in scss file, is there a nice way to do that?
Upvotes: 0
Views: 777
Reputation: 7819
If I understand what you are asking: you can't do that.
That's because the import 'xxx.scss'
is performed offline, at the time you build your application and the bundler (webpack, or whatever you are using) will parse SCSS and transform it to static or inline css.
So you can't distribute a component that read a SCSS file from a prop. Try to look at something like a theme provider.
Upvotes: 1