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
[Grid] Discussion gutter behaviour #7549
Comments
Why do you prefer padding? You left this out of your description. An element's margin is outside if its contents. By applying the gutter with a margin, its border, padding, and contents exist within the gutters. Using padding for the Layout gutters would insert the intended spacing between the margin + border and the contents. |
Could it be a duplicate of #7466? The negative margin has some limitations.
There is work around for all these limitations. I'm not aware of a better implementation yet. |
@stunaz I think @oliviertassinari is right, it seems to be a duplicate of #7466 because your issue is a side-effect of using negative margin. Take a look at this fork of your sandbox. One of the ways you can deal with this is by undoing the top margin on the inner container. example has been corrected |
your fork is identical to mine. |
Sorry @stunaz. The approach was to add marginTop: 0 to the inner container. Here is a different approach: Wrap your inner container in an item. |
I see, thanks |
@Hospes I have been suggesting 3 workarounds. |
I use the first option for now. I will probably try the second option a bit later. |
@stunaz Why would you change the default gutter value? I do think that the issue isn't representative of the 80%. I have been using this Grid implementation for almost a year now on different projects. I have only noticed it here. The reason is simple, I have never used the grid component for the general layout of the apps, only for children elements, where the distance with the body is large enough not to see the issue. |
I was designing my app using the
Layout
features provided by material-ui@next, I had some trouble du to the fact thatgutter
properties makes grow my container by gutter/2 with the extra margin applied. now after reading the code, I came to conclusion that it was intentional.But i found it counterintuitive, I would rather have the
gutter/2
applied to thepadding
properties than to themargin
properties of thecontainer
What to do you think?
Versions
The text was updated successfully, but these errors were encountered: