-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[ButtonBase] Check if margin: 0
can be removed
#26384
Comments
Generally, none of the components should set margin as a rule of thumb. We plan to revisit this issue, which is specific to the Button component. My suggestion would be instead of using |
margin: 0
can be removed
margin: 0
can be removedmargin: 0
can be removed
Thanks for the trick (I already used a workaround in my code, using |
Emotion is injecting the CSS based on the rendering order, so you cannot really change this. In cases like this, increasing specificity is required. |
I believe that the intention of the author is to implement gap-like. flexbox I am closing this issue. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @goffioul How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
I have a CSS injection problem that is illustrated by this sandbox:
https://codesandbox.io/s/material-ui-v5-css-injection-order-9y2oe
In essence, I define a component as follow:
I then use the component to host a series of buttons:
The problem is that
Button
component sets margin to 0. This rule has the same priority as the one (& > *
) used in the container. So the end result will depends on the order of the injection of CSS. And it seems to be non-deterministic. While building the sandbox, the order what was I wanted, and I couldn't reproduce the issue I was having in my larger app. So I started to add more elements from my app, namely a customThemeProvider
andCacheProvider
. Then the order changed, showing the issue. But after reverting all those changes and getting back to the simpler example, the order didn't change back. I have no idea what made the injection order to change and/or how to control it.The text was updated successfully, but these errors were encountered: