-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
[docs] className order or specificity #7763
Comments
I'm not sure to follow, how is this related to Material-UI? A reproduction example would be much better. You can use codesandbox or webpackbin :). The only specificity logic we have in Material-UI is right here: withStyles.js. |
I was trying to build a component for Material-UI, I don't know how to reproduce it in a simple example, but let's try with this. Is there any way of making the |
Yes, you can with the -export default withStyles(styles)(A);
+export default withStyles(styles, {
+ index: 0,
+})(A); |
I have improved the documentation |
If I have a component
A
with some styles using CSS-in-JS, that can receive aclassName
prop like this:And another component
B
that uses componentA
:The thing is: the B classes are being added to the dom before A classes, and since they're all a single class selector the last one have higher priority.
Is there a right way of handle this?
The text was updated successfully, but these errors were encountered: