-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 Container Rework #10371
Grid Container Rework #10371
Conversation
… as well as modified visual test to show this visually.
@brettsmason In v6, its <button type="button" class="button primary">Primary</button> In v7 (ofcourse with optional namespace and healthchecks) its gonna be <button type="button" class="button button--primary">Primary</button> So why not follow the same pattern with <div class="grid-container full"></div> and change like this in 7 <div class="grid-container grid-container--full"></div> |
@IamManchanda Yeah that's what I was thinking. I'll change that later. My one question regarding the If you take a look at the visual test you will see what I mean. Do you think this makes sense/is correct? |
On a readthrough, this looks good to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM... Merging!
The docs copy is updated ... Awesome work again @brettsmason 😉 |
I'm testing the 6.4.2 now and I don't get the reason for To be honest I don’t even understand why there is the class |
@OndrejVasicek Here's a CodePen to illustrate the differences: https://codepen.io/brettsmason/pen/RZjdKo You are correct in that you don't really need a container if you are going for the The padding is there as now the grid container adds padding to margin and padding grids. This now means you can use both gutter types in the same design as the columns line up correctly (see in the top 2 examples they don't). Prior to 6.4.2 if using padding gutters on one element and margin gutters on another, the columns wouldn't be in line with each other. Hope that makes sense. |
Thank you Brett. It makes sense but it raises new question – I thought that one of the reasons we have now padding and margin gutters is the different behaviour on the edges (margin goes to the edge, padding have some padding). But now if I use container, it behaves the same. What’s the difference between padding and margin gutters in this case? When I should use padding and when margin? It seems like the existence of one of them is useless in case of using container. Or was there a reason why it aligns the edges on the same places when using container? |
Just to add my two cents: the difference in padding/margin inside a grid-container would allow for colored backgrounds on padded cells, with contents still aligned to margin cells. Like this: Codepen |
…g to grid-margin layouts as per (foundation/foundation-sites#10371)
…g to grid-margin layouts as per (foundation/foundation-sites#10371)
First take on the reworked grid container. Updates docs to show usage as well as modified visual test to show this visually.
To confirm what this does:
grid-container
to have padding by defaultgrid-container-padded
but use its variables for the container paddinggrid-container-fluid
andgrid-container-full
grid-padding-x
have negative margins if withingrid-container/grid-container-fluid
to properly line up with margin gridsThis should get some solid testing before merging just to make sure this is the behaviour we want, but from the visual tests it works great.