tsnolan23 / tailor-react-spa

A demo React app using Tailor with common dependencies between fragments
80 stars 33 forks source link

css override issue while using multiple fragments with same class name #1

Closed awasthishivendra01 closed 6 years ago

awasthishivendra01 commented 6 years ago

I have created two react fragments. and i have imported custom.css file for these two fragments having same class name, when i run on single template then css is overriding, Is there any solution for tailor component so that css having same class name in multiple apps do not override.

Thanks in advance for your help!

tsnolan23 commented 6 years ago

@awasthishivendra01 It sounds like what you're describing is not an issue with Tailor itself, but just how CSS behaves in general.

To prevent the issue you're experiencing, you can check out scoping your CSS - applying hashes to each className to prevent conflicts in the global namespace. There are several options for doing so when using webpack.

awasthishivendra01 commented 6 years ago

@tsnolan23 , Yes i tried to fix that using sass it works for me, now there is no confliction.

Thank You!