Add button group and full width button styles#1309
Conversation
af9a849 to
1b404fb
Compare
| // Ideally we'd use `gap` with flexbox rather than having to do it all with | ||
| // margins, but unfortunately the support isn't there (yet) and @supports | ||
| // doesn't play nicely with it | ||
| // (https://github.com/w3c/csswg-drafts/issues/3559) |
There was a problem hiding this comment.
We're using gap for the new Header account section, so maybe support is ok for it now? https://github.com/nhsuk/nhsuk-frontend/pull/1058/files#diff-9872b34d22a8af3575af4913b03966d1994a4c9e966fddbaa977458158892ca1R119 cc @paulrobertlloyd
There was a problem hiding this comment.
Usual caveat, I copied from GOV.UK Frontend!
Mainly leaving this PR here for all the designers to chip in with their tweaks
There was a problem hiding this comment.
We use gap in the header, but not as much as we once did; the navigation used it, but it meant items were bunched up on older versions of Safari locked-to-the-last-support-version-of-iOS. Probably something we’d want to test across a number of different devices.
|
The NHS App team have already added button groups: https://design-system.nhsapp.service.nhs.uk/components/buttons/#grouping-buttons - they also have a We could consider something similar and have the behaviour opt-in, perhaps via |
|
Please, please, please can we replicate the GOV.UK behaviour and have buttons go full width on mobile by default? (I've been using my button group wrapper as a bit of a hack to enable this) |
@paulrobertlloyd Which breakpoint would you pick? 640 has always felt a bit too wide to me, but maybe its fine? 🤷
How about making it opt-in or opt-out? 🤔 |
|
Be bold @frankieroberto! < 640px is perfectly fine! (What do they do on the app?) |
The app has a modifier to make them full-width on mobile: https://github.com/nhsuk/nhsapp-frontend/blob/main/src/components/button/_index.scss#L14-L23 - I think @davidhunter08 and co did some research on it. |
|
This is great to hear, I purposely removed "full width by default" to match what we do now Shall I push an update to put it back?
Where 1) would align with the app, 111 online and NHS login's approach |
|
Happy to go with option 1 - full width buttons on mobile. Maybe it doesn't even need an opt-out? Would we consider it a breaking change though? 🤔 |
|
Yaaaaay!! |
1776dec to
b1d78af
Compare
e26199e to
baa60de
Compare
baa60de to
a3bddd9
Compare
a3bddd9 to
9440736
Compare
|
Updated to match the spacing in NHS App Frontend //cc @davidhunter08 |
9440736 to
1062c68
Compare
|
Thanks @frankieroberto Ahh in GOV.UK Frontend E.g. You'd want to wrap your "or" text into But looks like we need to iterate the NHS App spacing a little more for that |
cc58885 to
fa32fd4
Compare
fa32fd4 to
50d663c
Compare
|
|
Brilliant, shall we merge this and do testing as part of the pre-release? Noting that the styles were largely taken from the NHS App |
Add button group and full width button styles











Description
This PR aligns with GOV.UK Frontend by including:
The styles for
.nhsuk-button-groupwere initially copied from GOV.UK Frontend:But have now been updated to match NHS App Frontend spacing:
From NHS App Frontend Button component research:
Checklist