-
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
Fix layout_header layout and spacing issues #1924
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.
My main concern with this change is that we are moving away from the Design System component by removing classes (such as govuk-header__content
) instead of building on top of it when necessary.
As Accounts doesn't use static
, we should be able to use the Design System component (markup and classes) without any issues, and if we need to define additional rules to make the header compatible with static
, then we wrap those rules in a compatibility block as you previously did with other elements. By doing so we build on top of that component and we can remove the additional styles at a later stage, rather than diverging.
app/views/govuk_publishing_components/components/_layout_header.html.erb
Outdated
Show resolved
Hide resolved
c986299
to
a960388
Compare
a960388
to
2ab7e9e
Compare
Thanks @alex-ju, all good points. I think I've managed to make the necessary adjustments without touching the markup. |
2ab7e9e
to
aefc3e2
Compare
Thank you for working on this, @danacotoran! I have tested it on the public and admin layout and fixes mobile/tablet navigation issue as expected. May I suggest we update the changelog entry (and PR description) to be more clear what this fix does (e.g. Fix header navigation layout on mobile/tablet)? Hopefully, the |
I'm seeing a similar problem whilst trying to switch an app to use the gem's public layout (for example, alphagov/calculators#1033 and alphagov/static#2411) - so once the apps aren't using styles from static itself, we should be able to update the component to just work properly. Fingers crossed anyways... |
Currently, the layout header component looks different in the context of static vs in isolation. - on the account manager, which does not use static, the layout header navigation does not align as intended with the rest of the header on tablet devices - in the context of an application that uses static, the layout header inherits some styles from static. Additionally, application CSS will conflict with the layout_header CSS resulting in spacing issues. This aims to address some of these problems by removing unnecessary classes, as well as increasing layout_header CSS specificity where this CSS might be overruled by external styles from either static or the parent application's stylesheet.
layout_header
layout and spacing issues
layout_header
layout and spacing issuesaefc3e2
to
952e3d1
Compare
## 24.1.1 * Fix deprecation warnings when running tests ([PR #1899](#1899)) * Update `govuk-frontend` base SCSS imports ([PR #1922](#1922)) * Remove redundant import in accordion component ([PR #1923](#1923)) * Fix toggle click tracking on step-by-steps ([PR #1925](#1925)) * Accordion summary design adjustment ([PR #1926](#1926)) * Fix `layout_header` layout and spacing issues ([PR #1924](#1924))
The extra padding was added [1] to avoid a clash in layout when the component was used in Static. Wrapping the styles in a compatibility mode means that the layout remains fixed without causing forward compatibility issues. [1]: #1924
The extra padding was added [1] to avoid a clash in layout when the component was used in Static. Wrapping the styles in a compatibility mode means that the layout remains fixed without causing forward compatibility issues. [1]: #1924
What
Fix header navigation layout issue which happens on tablet breakpoints on GOVUK Accounts.
Fix spacing issue which occurs when
layout_header
is used by applications usingstatic
.Why
Currently, the layout header component looks different in the context of
static
vs in isolation. This is because this component shares some classes with the hardcoded#global-header
from static, as well as some layout classes from the Design System.static
, the layout header navigation does not align as intended with the rest of the header on tablet breakpointsBefore
After
static
(screenshots below are fromfinder-frontend
), the layout header inherits some styles fromstatic
. Additionally, application CSS conflicts with thelayout_header
CSS resulting in spacing issues, such as extra padding pictured belowBefore
After
This aims to address some of these problems by removing unnecessary classes, as well as increasing
layout_header
CSS specificity where this CSS might be overruled by external styles from eitherstatic
or the parent application's stylesheet.