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

updated design for header search open/close button #4216

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

## Unreleased

* Change to add text 'Search' to search dropdown button. this is postfixed with visually hidden 'GOV.UK'. Open state has text 'Close' added. Mobile view should have text for both states completely visually hidden with just icons visible. ([PR #4216](https://github.com/alphagov/govuk_publishing_components/pull/4216))
* Use component wrapper in hint component ([PR #4214](https://github.com/alphagov/govuk_publishing_components/pull/4214))
* Hide printed URLs when printing tables ([PR #4209](https://github.com/alphagov/govuk_publishing_components/pull/4209))
* Fix action link component print styles ([PR #4213](https://github.com/alphagov/govuk_publishing_components/pull/4213))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

$chevron-indent-spacing: 7px;
$black-bar-height: 50px;
$search-width-or-height: $black-bar-height;
$pseudo-underline-height: 3px;
$button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);

Expand Down Expand Up @@ -609,11 +608,11 @@ $after-button-padding-left: govuk-spacing(4);
border: 0;
color: govuk-colour("white");
cursor: pointer;
height: $search-width-or-height;
height: $black-bar-height;
padding: govuk-spacing(3);
position: relative;
width: $search-width-or-height;
@include govuk-font($size: 19, $weight: "bold", $line-height: 20px);
width: 57px;
@include govuk-font($size: 16, $weight: "bold", $line-height: 20px);

@include focus-and-focus-visible {
@include govuk-focused-text;
Expand All @@ -639,6 +638,7 @@ $after-button-padding-left: govuk-spacing(4);
border: 0;
margin: 0;
right: 0;
width: 130px;

@include focus-not-focus-visible {
border-bottom: 1px solid govuk-colour("dark-blue");
Expand Down Expand Up @@ -741,7 +741,14 @@ $after-button-padding-left: govuk-spacing(4);
top: 0;

.gem-c-layout-super-navigation-header__open-button & {
display: block;
display: inline-block;
}
}

.gem-c-layout-super-navigation-header__search-toggle-button--blue-background {
.gem-c-layout-super-navigation-header__navigation-top-toggle-close-icon,
.gem-c-layout-super-navigation-header__search-toggle-button-link-text-close {
color: $govuk-link-colour;
}
}

Expand Down Expand Up @@ -868,10 +875,40 @@ $after-button-padding-left: govuk-spacing(4);
}
}

.gem-c-layout-super-navigation-header__search-toggle-button--large-navbar {
padding-left: 24px;
padding-right: 24px;
width: 68px;
.gem-c-layout-super-navigation-header__search-item {
.gem-c-layout-super-navigation-header__search-toggle-button-link-text-open {
display: inline;
@include govuk-media-query($until: "desktop") {
@include govuk-visually-hidden;
}
}

.gem-c-layout-super-navigation-header__search-toggle-button-link-text-close {
display: none;
}

.gem-c-layout-super-navigation-header__open-button {
.gem-c-layout-super-navigation-header__search-toggle-button-link-text-open {
display: none;
}

.gem-c-layout-super-navigation-header__search-toggle-button-link-text-close {
display: inline;
@include govuk-media-query($until: "desktop") {
@include govuk-visually-hidden;
}
}
}
}

.gem-c-layout-super-navigation-header__search-toggle-button-link-text-open,
.gem-c-layout-super-navigation-header__search-toggle-button-link-text-close {
margin-left: govuk-spacing(1);
vertical-align: top;
}

.gem-c-layout-super-navigation-header__search-toggle-button-link-text-close {
color: $govuk-text-colour;
}

.gem-c-layout-super-navigation-header__navigation-second-item-description {
Expand Down Expand Up @@ -961,7 +998,11 @@ $after-button-padding-left: govuk-spacing(4);
.gem-c-layout-super-navigation-header__search-toggle-button--large-navbar {
height: $large-navbar-height;
// to stop the search icon moving on hover
padding-bottom: 12px;
padding-bottom: 6px;
}

.gem-c-layout-super-navigation-header__open-button {
padding-bottom: 3px;
}

.gem-c-layout-super-navigation-header__button-container--large-navbar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
navigation_menu_heading = t("components.layout_super_navigation_header.navigation_menu_heading")
navigation_search_heading = t("components.layout_super_navigation_header.navigation_search_heading")
navigation_search_subheading = t("components.layout_super_navigation_header.navigation_search_subheading")
search_text = t("components.layout_super_navigation_header.search_text")
search_text = t("components.layout_super_navigation_header.search_text_html")
close_text = t("components.layout_super_navigation_header.close_text")

hide_search_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => "search")
show_search_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "search")
Expand Down Expand Up @@ -196,21 +197,25 @@
hidden: true,
type: "button",
}) do %>
<span class="govuk-visually-hidden">
<%= search_text %>
</span>

<%=
render "govuk_publishing_components/components/search/search_icon", {
classes: %w[gem-c-layout-super-navigation-header__search-toggle-button-link-icon],
}
%>
<span class="gem-c-layout-super-navigation-header__search-toggle-button-link-text-open">
<%= search_text %>
</span>
<span
aria-hidden="true"
class="gem-c-layout-super-navigation-header__navigation-top-toggle-close-icon"
focusable="false"
>
&times;
</span>
<span class="gem-c-layout-super-navigation-header__search-toggle-button-link-text-close">
<%= close_text %>
</span>
<% end %>

<%= link_to "/search", {
Expand Down
3 changes: 2 additions & 1 deletion config/locales/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ ar:
show_button: إظهار البحث
top_level: أفضل مستوى
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -130,7 +131,7 @@ ar:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: من
history: المحفوظات
Expand Down
3 changes: 2 additions & 1 deletion config/locales/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ az:
show_button: Axtarışı göstər
top_level: Yüksək səviyyəli
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -127,7 +128,7 @@ az:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: "...dan (dən)"
history: Tarix
Expand Down
3 changes: 2 additions & 1 deletion config/locales/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ be:
show_button: Паказаць вынікі пошуку
top_level: Верхні ўзровень
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -133,7 +134,7 @@ be:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: З
history: Гiсторыя
Expand Down
3 changes: 2 additions & 1 deletion config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ bg:
show_button: Показване на търсенето
top_level: Първо ниво
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -131,7 +132,7 @@ bg:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: От
history: История
Expand Down
3 changes: 2 additions & 1 deletion config/locales/bn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ bn:
show_button: অনুসন্ধান দেখান
top_level: শীর্ষ পর্যায়
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -128,7 +129,7 @@ bn:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: থেকে
history: ইতিহাস
Expand Down
3 changes: 2 additions & 1 deletion config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ cs:
show_button: Zobrazit vyhledávání
top_level: Nejvyšší úroveň
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -132,7 +133,7 @@ cs:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: 'Komu I:'
history: Historie
Expand Down
3 changes: 2 additions & 1 deletion config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ cy:
show_button: Dangos y chwiliad
top_level: Lefel uchaf
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -131,7 +132,7 @@ cy:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: Gan
history: Hanes
Expand Down
3 changes: 2 additions & 1 deletion config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ da:
show_button: Vis søgning
top_level: Øverste niveau
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -128,7 +129,7 @@ da:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: Fra
history: Historie
Expand Down
3 changes: 2 additions & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ de:
show_button: Suche anzeigen
top_level: Oberste Ebene
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -131,7 +132,7 @@ de:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: Von
history: Geschichte
Expand Down
3 changes: 2 additions & 1 deletion config/locales/dr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ dr:
show_button: جستجو را نمایش دهید
top_level: سطح بالا
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -129,7 +130,7 @@ dr:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: از
history: پیشینهء جستجو
Expand Down
3 changes: 2 additions & 1 deletion config/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ el:
show_button: Εμφάνιση αναζήτησης
top_level: Κορυφαίο επίπεδο
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -127,7 +128,7 @@ el:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: Από
history: Ιστορικό
Expand Down
4 changes: 3 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ en:
show_button: Show search
top_level: Top level
layout_super_navigation_header:
close_text: Close
close_text: Close
logo_link_title: Go to the GOV.UK homepage
logo_text: GOV.UK
menu_toggle_label:
Expand Down Expand Up @@ -234,7 +236,7 @@ en:
navigation_menu_heading: Navigation menu
navigation_search_heading: Search and popular pages
navigation_search_subheading: Search
search_text: Search GOV.UK
search_text_html: Search <span class="govuk-visually-hidden">GOV.UK</span>
metadata:
from: From
history: History
Expand Down
3 changes: 2 additions & 1 deletion config/locales/es-419.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ es-419:
show_button: Mostrar búsqueda
top_level: Nivel superior
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -127,7 +128,7 @@ es-419:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: Desde
history: Historial
Expand Down
3 changes: 2 additions & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ es:
show_button: Mostrar búsqueda
top_level: Nivel superior
layout_super_navigation_header:
close_text: Close
logo_link_title:
logo_text:
menu_toggle_label:
Expand All @@ -127,7 +128,7 @@ es:
navigation_menu_heading:
navigation_search_heading:
navigation_search_subheading:
search_text:
search_text_html:
metadata:
from: Desde
history: Historial
Expand Down
Loading
Loading