-
Notifications
You must be signed in to change notification settings - Fork 673
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
[css-grid] Gap background splitting #2117
Comments
I think the "ignore-gap" for concrete "cells" will be better solution. The grid cell will be enlarged 0.5 size of gap in all direction if ignore-gap is enabled. |
@Nadya678 It sounds like that will help when there is single items on the grid that need to ignore gap. In the situation I describe above though, that would mean I still need to apply padding to all grid items. Correct? |
In the given example, I see the gap between the columns twice as wide as gaps between the edges and the columns. This is not how So I don't see the need to introduce extra complication like suggested here. I'm for keeping the gutter concept as simple as it is, and using existing grid features for creating areas with background. |
This doesn't seem very compatible with the CSS box model; for example, where's the border in this example? The fact that it can be fairly simply achieved with 'padding' suggests that it doesn't need to be specially solved for Grid here, which would introduce extra complexity to the Grid model, both for authors and for implementors. |
Related to: https://www.w3.org/TR/css-grid-1/#gutters
From all CSS Grid Layout onboarding resources I have experienced, the
gap
properties have been described as the rules to handle your grid gutter with. I think it is helpful when the grid follows a single background color (Ex 1) or every item includes extra padding (Ex 2).However, many visual designers use background color to identify separations in a grid (Ex 3). This is a common use-case that I hope CSS Grid Layout can support:
The current way to achieve this use-case is to use no
gap
rules and instead apply a padding class to all items on the grid.Proposed Solution:
Introducing a new property and rule for the grid parent called
gap-background: split;
that would let the background values of adjacent items expand to meet halfway at the gutter. I am proposing this solution because I believe it would give CSS Grid Layout the capabilities that print-based designers would assume it had.The text was updated successfully, but these errors were encountered: