Make centre rule configurable in grid module#15951
Conversation
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
acda072 to
c98180b
Compare
|
It looks like the centre column has disappeared for the images at the desktop breakpoint? I can only see it appearing on the ads. |
Ah yep, my bad. Fixed with 940bc29
|
940bc29 to
b90f67d
Compare
JamieB-gu
left a comment
There was a problem hiding this comment.
Thanks @frederickobrien . Looking at your screenshot above it looks like you've picked up an extra border on the left hand side with that change?
A few other small comments.
| type VerticalRuleOptions = { | ||
| centre?: boolean; | ||
| color?: string; | ||
| plusChild?: number; |
There was a problem hiding this comment.
I may be misunderstanding something, but what does the "plus" refer to in plusChild?
There was a problem hiding this comment.
That was the idea yes but agree it's unclear. Have changed to a stadndalone centreRule which together with the number is more readable I think(?). E.g.
${grid.centreRule(2)}b90f67d to
6719ce9
Compare
d5cd11f to
172a642
Compare
|
After thinking about it I've gone a step further and separated ${grid.container}
${grid.outerRules()}
${grid.centreRule(1)}
${from.leftCol} {
${grid.centreRule(3)}
}I think this is more readable and allows for flexibility across breakpoints. |
466d913 to
d3ea03b
Compare
528bb6f to
a06b8bf
Compare
JamieB-gu
left a comment
There was a problem hiding this comment.
Looks good, a few last comments.
a06b8bf to
ad559c4
Compare
|
Seen on PROD (merged by @frederickobrien 8 minutes and 19 seconds ago) Please check your changes! |





This rejigs the
verticalRulesoption added to thegridmodule in #15760 so that its configurable to the nth child of the grid, rather than the first by default. This has come up while working on #15358 and #15922 and feels like a worthwhile change in its own right as the central rule is likely to align with different pieces of article furniture depending on the layout (and breakpoint).Instead of a binary yes/no on the centre rule which applies to the first child regardless, this makes it more controlled by separating
verticalRulesandcentreRuleinto separate options:As a proving ground this PR applies the new approach to the gallery layout, which was the first to adopt
grid-based vertical rules in #15776. I've also applied it to #15428 and it feels pretty tidy.