-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to move global styles into scope for emotion ? #1789
Comments
Demo which I've posted on Twitter regarding this issue can be found here: https://codesandbox.io/s/upbeat-morning-8rfur I believe this solves the problem in the best possible way. Emotion styles are just styles, so if you integrate with non-emotion styles you, unfortunately, need to fight specificity wars. |
Thank you again @Andarist π I've update the stack overflow post: https://stackoverflow.com/questions/60567233/how-to-move-global-styles-into-a-scope-for-emotion with your best solution |
@Andarist what if the children are of a different CSS framework. Like they are based off tailwind and I want them to retain their original styles and not the one from the global styles. |
Thank you for this nice library and all effort that you make ππΌββοΈ
I'm currently need to integrate common components of a library into multiples websites. The component Library currently have a Global styles. That they inject in the following way:
I want there "Global styles" only available for the components of this library. They are only on a part of the page.
So I've try this:
But it seems that everything in
Styles
has the priority. Then if the component haspadding: 10px;
it will takepadding: 0;
ofStyles
Here is the issue reproduced:
I know It's a css issue but I want to solve it with emotion
I've already saw:
The text was updated successfully, but these errors were encountered: