Skip to content
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

Remove padding-right from details component #2312

Merged
merged 2 commits into from
Aug 24, 2021

Conversation

edwardhorsford
Copy link
Contributor

@edwardhorsford edwardhorsford commented Aug 13, 2021

The details element doesn't need padding-right - having it will mean contents don't line up nicely with the rest of the page.

Browser Before After
Chrome govuk-frontend-review herokuapp com_full-page-examples_what-is-your-nationality(Chrome) govuk-frontend-pr-2312 herokuapp com_full-page-examples_what-is-your-nationality(Chrome)
Safari mobile govuk-frontend-review herokuapp com_full-page-examples_what-is-your-nationality(iPhone 6_7_8) govuk-frontend-pr-2312 herokuapp com_full-page-examples_what-is-your-nationality(iPhone 6_7_8)

@edwardhorsford edwardhorsford changed the title Remove padding-right Remove padding-right from details element Aug 13, 2021
@lfdebrux lfdebrux added design 🕔 hours A well understood issue which we expect to take less than a day to resolve. labels Aug 13, 2021
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2312 August 13, 2021 14:58 Inactive
@36degrees 36degrees self-requested a review August 17, 2021 09:05
@lfdebrux
Copy link
Member

lfdebrux commented Aug 17, 2021

This was discussed in a thread asking why the right padding is present in the #govuk-design-system channel in x-gov Slack. I shared the question with designers in an internal Slack thread, @joelanman and @christopherthomasdesign agreed that it didn't need to be there. Looking at the git history, the right padding has been there since this component was added (see commit 2e6769a), with no reason given as to why it is there.

@vanitabarrett vanitabarrett added this to the [NEXT] milestone Aug 17, 2021
@36degrees
Copy link
Contributor

Looking at the git history, the right padding has been there since this component was added (see commit 2e6769a), with no reason given as to why it is there.

The details component came from Elements, where it was known as hidden text. In Elements, it used the 'panel' styles which were shared with inset text and conditional reveals, so changes to those panel styles affected all three things.

At one point, there was no right padding on the panel. However, this was changed in alphagov/govuk_elements@af2375b (part of alphagov/govuk_elements#106), when the spacing was adjusted 'so the padding is 15px on all sides'. As far as I can tell, there's been padding on all sides ever since.

I do think this change makes sense though – it makes it consistent with the conditional reveals which don't have right padding either.

@36degrees
Copy link
Contributor

Just to record a conversation from Slack – we discussed whether the right padding should be retained at the mobile breakpoint as it can look a little 'unbalanced', and adding padding on both sides emphasises the ‘inset’ nature:

Before After
govuk-frontend-review herokuapp com_full-page-examples_what-is-your-nationality(iPhone 6_7_8) govuk-frontend-pr-2312 herokuapp com_full-page-examples_what-is-your-nationality(iPhone 6_7_8)

However, we ultimately agreed to remove the right padding on mobile (which is the change already proposed in this PR) because:

  • it's consistent with the way padding works on conditional reveals
  • it maximises the horizontal space available to users to see what they're writing, especially on smaller screens

Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @edwardhorsford – are you able to add an entry to the changelog?

It'd also be really useful to include before/after screenshots in the PR description, if possible.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2312 August 18, 2021 13:58 Inactive
@edwardhorsford
Copy link
Contributor Author

@36degrees updated description with your screenshots and added an entry in the changelog.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2312 August 24, 2021 13:33 Inactive
@36degrees
Copy link
Contributor

Rebased against main to resolve a conflict in the changelog.

@36degrees 36degrees merged commit 450252d into alphagov:main Aug 24, 2021
@EoinShaughnessy EoinShaughnessy changed the title Remove padding-right from details element Remove padding-right from details component Aug 31, 2021
@vanitabarrett vanitabarrett mentioned this pull request Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design 🕔 hours A well understood issue which we expect to take less than a day to resolve.
Projects
Development

Successfully merging this pull request may close these issues.

6 participants