-
Notifications
You must be signed in to change notification settings - Fork 334
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
Fix Accordion margin/padding inconsistencies #3094
Conversation
Affects smaller screens
Fixes a minor regression in: * 879e37c The bottom margin should be increased at tablet size (not desktop) so it matches up with the “Show all” button font size change
During a slow page load, the accordion content was briefly visible *without* padding
dc49960
to
84e7049
Compare
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.
Looks good to me.
I wonder if the excess button padding-bottom is a layover from the older accordion design, where the following content didn't have any top padding, which was added in #2640? Either way, makes sense to reduce it now.
@@ -79,7 +83,7 @@ | |||
cursor: pointer; | |||
-webkit-appearance: none; | |||
|
|||
@include govuk-media-query ($from: desktop) { | |||
@include govuk-media-query ($from: tablet) { |
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.
Font sizes increase from tablet
so we can add this margin sooner too
Thanks @querkmachine 🙌 |
Just a quick PR to fix a few tiny Accordion issues we've had for a long time in:
"Show all" button
margin-bottom
fix applied too wideMoves legacy bug fix to 'tablet' (from 'desktop') which align with font size
Section button
padding-bottom
jumps 10px taller on mobileNotice how the section button height appears to get taller (unlike tablet, desktop)
Trailing space in
class
attributeNow using
{%-
to trim whitespace as we do elsewhereSee original Accordion design PR
Plus a minor fix where accordion sections lack padding (during slow page loads) since:
hidden='until-found'
#3053Reducing layout shift
Whilst we know additional layout shifts take place when the accordion controls and section headers are injected, I've shifted
.govuk-accordion__section-content
content padding so it's applied whilst the JavaScript loadsOur Accordion sections are now open during page load, where previously we only added padding when
[hidden]
was added by componentinit()
but in preparation for the--expanded
modifier being toggled