-
Notifications
You must be signed in to change notification settings - Fork 19
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
Alternative header layout #1278
Conversation
7ddd914
to
10ae31d
Compare
10ae31d
to
4cd8250
Compare
bcde082
to
51fc63a
Compare
is it known that the nav menu is not visible on mobile? |
No, it wasn't... it was working previously I must have broken something. Looking into it. |
Fixed now, I'd accidentally optimised away the div that set the relative position. |
51fc63a
to
64e79a8
Compare
4cd8250
to
993b99c
Compare
993b99c
to
e1b8fec
Compare
e1b8fec
to
7ab881b
Compare
7ab881b
to
8d12349
Compare
8d12349
to
da1f566
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.
The layout at mobile is different anyway - the search bar is full width deliberately rather than half width to some arbitrary point where it gets hidden on live. Likewise the menu items don't try to cram into 2 columns. I thought it made more sense for the menu button to appear on the left than on the right if we're not putting the search over there. If you think it should be on the right, why? I'll look into the separated icon, though. |
I'm not sure which side it should be on, I was just pointing out the difference. Another slightly odd behaviour - if you expand the menu on mobile then switch to desktop the whole of the menu is pushed down slightly. Obviously this is a niche use case and doesn't represent a barrier to anything, it's just a little odd. |
app/views/govuk_publishing_components/components/docs/layout_header.yml
Outdated
Show resolved
Hide resolved
app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss
Outdated
Show resolved
Hide resolved
app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss
Outdated
Show resolved
Hide resolved
app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/_layout_header.html.erb
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/_layout_header.html.erb
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/_layout_header.html.erb
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/docs/layout_header.yml
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb
Outdated
Show resolved
Hide resolved
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.
Seems good, I have a few comments, mostly me being nitpicky, but a couple of things that might need looking at.
app/views/govuk_publishing_components/components/_layout_header.html.erb
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/_layout_header.html.erb
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
Outdated
Show resolved
Hide resolved
app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss
Outdated
Show resolved
Hide resolved
} | ||
|
||
} | ||
|
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.
Nitpick: I'd remove this blank line and line 83.
app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/_layout_header.html.erb
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb
Show resolved
Hide resolved
<div class="govuk-header__logo gem-c-header__logo"> | ||
<a href="/" class="govuk-header__link govuk-header__link--homepage"> | ||
<span class="govuk-header__logotype"> | ||
<svg role="presentation" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 132 97" height="32" width="36"> |
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.
role=presentation is being replaced with aria-hidden=true
see alphagov/govuk-frontend#1724
21f2b16
to
c345be1
Compare
64e79a8
to
f279af1
Compare
This adds a new layout alternative that allows for search on the left of the header and navigation items on the right to support some layouts seen in whitehall pages. It also corrects a stray div that was breaking the with-nav option without a searchbox.
- Concatenates the appropriate header classes before implementing them more simply - Reduces repitition in code where the search_left layout branches from the standard
This spacing that was added during development isn't doing anything but introduced a minor bug when resizing the browser with the nav open, so this removes it.
- Removes spurious space - Adds a description of where this variant of header is used
c345be1
to
3f71d08
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.
Additional new lines here
app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb
Outdated
Show resolved
Hide resolved
There are a couple of false positives with the automated accessibility tests caused by the component being repeated on the example page - it's not a problem with the component, as this is (hopefully) something that wouldn't happen in the real world use. We can turn off the checks by adding An alternative fix for the |
Fixed the spacing issues and the stray new lines introduce/overlooked previously. |
I've ignored those checks. The accordion example is different - you could potentially have multiple accordions on a single page, but you shouldn't have multiple headers at any time, so it needs the randomising approach whereas we don't here. |
What
Adds a new layout alternative to the layout header.
https://trello.com/c/vMiHP2yB/194-build-header-layout-for-search-on-left
Why
This is needed for pages in whitehall such as https://www.gov.uk/government/how-government-works
Notes: The layout change meant that the skeleton of the html needed to change. To avoid repeating blocks they are now in partials. I tried to do this with content blocks but it broke the component's examples page as each render of the content block appended itself to the previous ones before displaying.
This is being pushed back into a non-master branch so that individual chunks of work can be reviewed and monitored on Trello rather than pushing to one huge PR.
Screenshot