-
Notifications
You must be signed in to change notification settings - Fork 20
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
RFC 2: Add spacing (margins) model to components #292
Conversation
I'm not sure about the using a "value" to set the margins - the 1-5 system seems fairly arbitrary and is confusing to understand. I'd find it confusing to supply '3' to get a half margin, for example. Along the same lines, I'm also not sure on the readability of A couple of questions, more than comments:
|
I agree with Vanita on the arbitrary values mapping to two-thirds etc - I saw that you'd raised it as a possible concern already, but I do think it's somewhat opaque in meaning and there would be a fair bit of digging around to find the relevant mapping when building or implementing a new component. It would be good to tidy up the differences between components (false vs 0 vs "" for flags, for example) but I think it needs to be more understandable at a glance than this proposition. |
I agree with all of these points. Does anyone have any suggestions? |
I think any implementation we come up is likely to be complicated enough that it will need to be documented for developers to be able to add it to any new or existing components. I guess an alternative is to take the smallest value (say, gutter-one-quarter) and do the scale as multiples of that. So 1 would be one quarter, 2 would be two quarters, etc. It still doesn't match exactly but it makes a little bit more sense. |
Awesome RFC, great to see something so well thought out. 👍 Alternatives to the proposed kind of scale include 't-shirt' sizing, but that can get confusing with 'xxxl' or 'xxxs' etc. Similar problems would be ran into if you used 'large' 'larger' 'largerest' etc. We've opted for a number based scale, with documentation explaining how it works. In terms of the interface for the spacing, you could consider a more boring approach. For the most part, vertical rhythm is best set via margin on the bottom of components. With this in mind, the majority of times you'll only want to set So you could have Your questions:
This proposal could deprecate those methods, it may be easy to replace them if this RFC is accepted.
It'd be good to have you folks see the spacing scale in the design system, as it may help solve this problem.
Since most components can have the same default margin, we're setting the same margin by default. This means for the most part you don't have to worry about spacing for vertical rhythm, and add spacing in for the cases where you need something different. This is the same way the current components with spacing work, where they can have their spacing set to 0. Finally, since the new GOV.UK Design System has a spacing scale that aims to solve this same issue, it would be good to align on this if possible. I think it would provide a similar solution as described in this RFC. |
Thanks for all the input everyone. I'm going to close this RFC for now. I think that while a system like this to apply margin to all components is possible, due to the complexity of the existing margins on components and how closely that's tied to the design of the site this issue is larger than just FE. My recommendation is that we plan to take a look at this again later, perhaps as part of a mission team, and include a proper audit of the existing components and the design context in which they're used. My hope is that as GOV.UK becomes more componentised over time this will be easier to solve. For now I'm going to try a model similar to the one proposed on one component (heading) and see how well it works. |
👉 Rendered version