New - Grid Row-Gap #1046
Closed
markblandford
started this conversation in
Canopy requests
Replies: 1 comment 9 replies
-
Hi Mark, thanks for raising a request. Maybe I've misunderstood but are you saying that you're seeing zero margin by default? Or that you'd like the ability to specify a custom margin? @elenagarrone I wonder if this is a bug? There's definitely no scenario where we'd deliberately want zero horizontal margin between cards. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Type of request
New
Component, pattern or foundation?
Foundation maybe?
Nature of request
Unless I'm mistaken (I can't find anything in the docs of Canopy or Flexboxgrid), there is no built-in way to specify the CSS
row-gap
property on anlgRow
element. As such, when a row 'stacks' there is no Canopy way to specify the 'gap' between flex items in the row.For example, this HTML:
Generates:
As you can see, there is no 'gap' between the flex items when stacked (I've removed the margin on the cards for demonstration purposes only).
Adding the
row-gap: 1rem;
to thelgRow
<div>
, leads to no change in the rendering when the cards / flex items are in a row, but when they become stacked, we see a nice, consistent1rem
gap between each item:Proposal
I propose the following:
lgRowGap=
directive, where a consumer of Canopy can specify the CSS row-gap property and it's value. If a value is not provided, it will default tovar(--space-sm)
..lg-row-gap--#{$val}
along the same lines as as the existing,.lg-margin--#{$val}
, so the same can be achieved with a CSS class.I am not proposing any
column-gap
behaviour, as I feel the existing Canopy grid sort of already deals with this quite nicely (and was previously discussed in issue 198 in Flexboxgrid).This can of course be achieved, as I have done above, by simply adding the style in the consuming app, but given the 'grid' is handled by Canopy, I feel it should be able to support this.
If this is accepted, I would like the opportunity to contribute and create a PR.
Beta Was this translation helpful? Give feedback.
All reactions