Replies: 2 comments 2 replies
-
This seems like a great idea |
Beta Was this translation helpful? Give feedback.
0 replies
-
For that I have used: https://www.npmjs.com/package/postcss-increase-specificity and it works perfectly. ps: Also I think the best solution to avoid css override is to use shadow dom but currently it is not possible to use it with vanilla-extract: #488 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We're using vanilla extract for styling snippets that render onto other people's pages. We love it because of how compressible it can be and that there's no runtime cost on the pages we render on. One thing I was wondering is could we programmatically set the specificity for the styles?
Example:
With the example above the color will be black and our styles are overridden. We never want our styles to be overridden for our use case.
What I'd love to be able to do is to turn up the specificity of all vanilla extract styles to make them look like this:
I know this is a bizarre request, and I don't think it's something that should live in the core lib. I'd love some direction on if this is possible and how I could implement this. Otherwise I'm having to rely on inline styles. 😦
Beta Was this translation helpful? Give feedback.
All reactions