-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement new header component for homepage
Move the inverse_header to a seperate partial. Implement the new homepage_header as a seperate partial. Add logic for toggling the new header on and off using the `new_design` url parameter.
- Loading branch information
1 parent
dbfd4ca
commit 00ac52d
Showing
10 changed files
with
203 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
@import "govuk_publishing_components/individual_component_support"; | ||
|
||
$pale-blue-colour: #d2e2f1; | ||
|
||
.homepage-header { | ||
background-color: $govuk-brand-colour; | ||
padding-bottom: govuk-spacing(7); | ||
padding-top: govuk-spacing(4); | ||
@include govuk-typography-common; | ||
|
||
@include govuk-media-query($from: desktop) { | ||
padding-bottom: govuk-spacing(8); | ||
padding-top: govuk-spacing(6); | ||
} | ||
} | ||
|
||
.homepage-header__title { | ||
@include govuk-typography-weight-bold; | ||
color: govuk-colour("white"); | ||
font-size: 40px; | ||
font-size: govuk-px-to-rem(40); | ||
line-height: 1.2; | ||
padding-bottom: govuk-spacing(2); | ||
margin: 0; | ||
|
||
@include govuk-media-query($from: tablet) { | ||
font-size: 60px; | ||
font-size: govuk-px-to-rem(60); | ||
} | ||
|
||
@include govuk-media-query($from: desktop) { | ||
font-size: 69px; | ||
font-size: govuk-px-to-rem(69); | ||
} | ||
} | ||
|
||
.homepage-header__intro { | ||
@include govuk-typography-weight-bold; | ||
|
||
color: $pale-blue-colour; | ||
font-size: 40px; | ||
font-size: govuk-px-to-rem(40); | ||
margin: 0; | ||
padding-bottom: govuk-spacing(2); | ||
line-height: 1.07; | ||
|
||
@include govuk-media-query($from: tablet) { | ||
font-size: 60px; | ||
font-size: govuk-px-to-rem(60); | ||
} | ||
|
||
@include govuk-media-query($from: desktop) { | ||
font-size: 69px; | ||
font-size: govuk-px-to-rem(69); | ||
} | ||
} | ||
|
||
.homepage-header__search { | ||
@include govuk-media-query($from: mobile) { | ||
@include govuk-grid-column($width: two-thirds); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
@import "govuk_publishing_components/individual_component_support"; | ||
|
||
.homepage-inverse-header { | ||
background-color: $govuk-brand-colour; | ||
padding-bottom: govuk-spacing(7); | ||
padding-top: govuk-spacing(8); | ||
@include govuk-typography-common; | ||
|
||
@include govuk-media-query($from: desktop) { | ||
padding-bottom: govuk-spacing(8); | ||
padding-top: govuk-spacing(9); | ||
} | ||
} | ||
|
||
.homepage-inverse-header__title { | ||
@include govuk-typography-weight-bold; | ||
color: govuk-colour("white"); | ||
font-size: 32px; | ||
font-size: govuk-px-to-rem(32); | ||
line-height: 1.2; | ||
margin: 0; | ||
padding-bottom: govuk-spacing(6); | ||
|
||
@include govuk-media-query($from: desktop) { | ||
font-size: 48px; | ||
font-size: govuk-px-to-rem(48); | ||
} | ||
} | ||
|
||
.homepage-inverse-header__intro { | ||
color: govuk-colour("white"); | ||
font-size: 19px; | ||
font-size: govuk-px-to-rem(19); | ||
margin: 0; | ||
padding-bottom: govuk-spacing(2); | ||
|
||
@include govuk-media-query($from: desktop) { | ||
font-size: 24px; | ||
font-size: govuk-px-to-rem(24); | ||
} | ||
} | ||
|
||
.homepage-inverse-header__intro--bold { | ||
@include govuk-typography-weight-bold; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<% | ||
add_view_stylesheet("homepage_header") | ||
%> | ||
|
||
<header class="homepage-header"> | ||
<div class="govuk-width-container"> | ||
<div class="homepage-header__title-container"> | ||
<h1 class="homepage-header__title" data-ga4-scroll-marker> | ||
<%= t('homepage.index.intro_title.short_text') %> | ||
</h1> | ||
<p class="homepage-header__intro homepage-inverse-header__intro--bold"> | ||
<%= t('homepage.index.intro_html') %> | ||
</p> | ||
</div> | ||
<div class="govuk-grid-row"> | ||
<div class="homepage-header__search"> | ||
<form | ||
action="/search" | ||
method="get" | ||
role="search" | ||
data-module="ga4-form-tracker" | ||
data-ga4-form-include-text | ||
data-ga4-form='{"event_name": "search", "type": "homepage", "url": "/search/all", "section": "Search", "action": "search"}' | ||
> | ||
<%= render "govuk_publishing_components/components/search", { | ||
button_text: t("homepage.index.search_button"), | ||
margin_bottom: 0, | ||
size: "large", | ||
label_size: "s", | ||
label_margin_bottom: 3, | ||
inline_label: false, | ||
label_text: t("homepage.index.search_label"), | ||
homepage: true, | ||
on_govuk_blue: true, | ||
margin_top: 7, | ||
data_attributes: { | ||
track_category: "homepageClicked", | ||
track_action: "searchSubmitted", | ||
track_label: "/search/all", | ||
track_dimension_index: 29, | ||
track_dimension: "Search GOV.UK", | ||
ga4_scroll_marker: true, | ||
}, | ||
} %> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -919,6 +919,7 @@ cy: | |
intro_simpler: | ||
intro_title: | ||
text: | ||
short_text: | ||
html: | ||
job_search: | ||
jobseekers_allowance: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters