Use grid module for StandardLayout, introduce vertical rules#15428
Use grid module for StandardLayout, introduce vertical rules#15428frederickobrien wants to merge 14 commits intomainfrom
StandardLayout, introduce vertical rules#15428Conversation
c8e046d to
b0f4bf5
Compare
StandardLayoutStandardLayout
bb14535 to
b752a6f
Compare
StandardLayoutStandardLayout, introduce vertical rules
ab9a1c2 to
0646448
Compare
|
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. |
81a91f8 to
e67e85c
Compare
2357924 to
cf39bf7
Compare
cbee04b to
12ef9bb
Compare
60a6347 to
31dca25
Compare
domlander
left a comment
There was a problem hiding this comment.
It may be easier to wait until the Football Redesign AB test is complete before merging this PR as it maybe be safer to ensure not disturbing their test. The WebX team have discussed here: #15402 (comment)
The gap between the center and right columns at the left-col breakpoint is now correct and looks infinitely better!
I'm also delighted to see negative margins be removed.
| ${from.desktop} { | ||
| display: block; | ||
| padding-top: 6px; | ||
| grid-row: ${isMedia ? 3 : 1} / span 999; |
There was a problem hiding this comment.
The 999 looks odd but I couldn't find a better solution. There doesn't look to be one for implicit rows: w3c/csswg-drafts#2402, so I think what you have might be best. I was mistaken before: grid-row: 1 / -1 only works for non-implicit grid rows I think.
There was a problem hiding this comment.
Yeah, I haven't found a nicer way. We could calculate the number of rows based on furniture layout but I could see that becoming gnarlier than the span 999 quite quickly
There was a problem hiding this comment.
Ok, I think I've cracked this with f21f751. By incorporating row spans into the furniture config we get the dual benefit of losing span 999 and (I think) making the furniture config more intuitive to use:
desktop: [
['title', 'right-column'],
['headline', 'right-column'],
['standfirst', 'right-column'],
['main-media', 'right-column'],
['meta', 'right-column'],
['body', 'right-column'],
]
f8d04e0 to
65fb6fa
Compare
65fb6fa to
825d214
Compare
5eb44e7 to
1752cc7
Compare
What does this change and why?
This refactors the
StandardLayoutto use thegridmodule, hopefully making it easier to reason with and style. This is with one eye on header standardisation work by @guardian/articles-and-publishing as well as a potential revamp of the interactive layout (see #15358).As part of this I've had a stab at introducing
verticalRulesto thegridmodule, allowing for lines to be added if they're wanted. After a few iterations I've made this something that's pure CSS and baked into the grid module itself.verticalRulesadds outer borders, whileverticalRules({ centre: true })adds an additional one to the left hand side of the centre column.This wound up being almost exactly the same amount of code but I think the outcome is good, with the beefed up grid module being something that could be applied to other layouts going forward.
A glimpse of the sorts of things this could enable: #15509
Context
Examples of different layouts
Standard
Showcase
Screenshots