-
Notifications
You must be signed in to change notification settings - Fork 338
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
Add list--spaced modifier #1775
Conversation
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.
Makes sense, think we'll need to add some new guidance to the Design System too.
Absolutely - I'm going to work on that later |
This modifier is designed to make lists easier to scan when the list items are long, and span multiple lines. Closes #1272
84641bc
to
be16c2e
Compare
On mobile, we do not include any margin after bulleted or numbered list items – the margin is only added on tablet and above. I'm wondering if we should be using a slightly smaller margin on mobile to be consistent and to better associate each bullet point with the lead-in paragraph: %govuk-list--spaced > li {
margin-bottom: govuk-spacing(2);
@include govuk-media-query($from: tablet) {
margin-bottom: govuk-spacing(3);
}
&:last-child {
margin-bottom: govuk-spacing(0);
}
} To my (non-designer) eyes the 15px on mobile otherwise seems excessive. Thoughts @timpaul or @christopherthomasdesign?
|
I think that typically the internal padding and margins of textual components should shrink by a similar proportion to the text shrinkage, so yep - I'd agree with your suggestion. @christopherthomasdesign - what do you think? There's no crazy vertical rhythm thing we're doing that I've forgotten about is there? |
Looks good to me @timpaul, good suggestion @36degrees 👍 |
Reduce the spacing on the spaced list items on mobile relative to the text size, and the fact that on mobile list items have 0 margin by default (vs 5px on tablet and mobile).
Because the ul has a bottom margin of 15px (mobile) or 20px (tablet, desktop) and the bottom margin of the last li will always have a smaller bottom margin, the two should collapse and so the margin on the last list item has no effect – thus we don't need any special treatment for it.
This proposal was approved by the Design System working group on 14 May 2020 |
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.
🎉
Nice work! 🎊 I've used this style a few times in the past. |
This modifier is designed to make lists easier to scan when the list items are long, and span multiple lines.
Closes #1272