Skip to content

Commit

Permalink
Match confirmation message to design system guidance.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgds committed Feb 12, 2021
1 parent 99f67e7 commit 2ecd674
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,6 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
}
}

.gem-c-cookie-banner__hide-button {
@include govuk-font($size: 19);
outline: 0;
border: 0;
background: none;
text-decoration: underline;
color: $govuk-link-colour;
padding: govuk-spacing(0);
margin-top: govuk-spacing(2);

&:hover {
color: $govuk-link-hover-colour;
cursor: pointer;
}

&:focus {
@include govuk-focused-text;
}

@include govuk-media-query($from: desktop) {
margin-top: govuk-spacing(0);
position: absolute;
right: govuk-spacing(1);
}
}

// Override the styles from govuk_template
// stylelint-disable selector-max-id
.gem-c-cookie-banner#global-cookie-message {
Expand All @@ -98,10 +72,4 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
@include govuk-font($size: 19);
margin: 0 0 govuk-spacing(2) 0;
}

.gem-c-cookie-banner__confirmation-message {
@include govuk-media-query($from: desktop) {
margin-bottom: 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<%
id ||= 'global-cookie-message'
title ||= "Cookies on GOV.UK"

text ||= raw("<p>We use some essential cookies to make this website work.</p>
<p>We’d like to set additional cookies so we and our partners can remember your settings, understand how you use GOV.UK and make improvements.</p>
")
text ||= raw("<p>We use cookies to collect information about how you use GOV.UK. Some of these are essential to make the site work.</p><p>We'd like to set additional cookies to understand how you use GOV.UK, remember your settings and improve government services.</p><p>We may also use cookies set by other sites to help us deliver content from their services.</p>")
cookie_preferences_href ||= "/help/cookies"
confirmation_message ||= raw("You can <a class='govuk-link' href='#{cookie_preferences_href}' data-module='track-click' data-track-category='cookieBanner' data-track-action='Cookie banner settings clicked from confirmation'>change your cookie settings</a> at any time.")
services_cookies ||= nil
Expand Down Expand Up @@ -74,7 +71,9 @@

<div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1" hidden>
<p class="gem-c-cookie-banner__confirmation-message" role="alert"><%= confirmation_message %></p>
<button class="gem-c-cookie-banner__hide-button" data-hide-cookie-banner="true" data-module="track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner">Hide</button>
<div class="govuk-button-group">
<button class="gem-c-cookie-banner__hide-button govuk-button" data-hide-cookie-banner="true" data-module="track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner">Hide this message</button>
</div>
</div>

</div>
Expand Down
5 changes: 2 additions & 3 deletions spec/components/cookie_banner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ def component_name
render_component({})
assert_select '.gem-c-cookie-banner[id="global-cookie-message"][data-module="cookie-banner"]'
assert_select ".gem-c-cookie-banner__heading", text: "Cookies on GOV.UK"
assert_select ".gem-c-cookie-banner__content", text: "We use some essential cookies to make this website work.
We’d like to set additional cookies so we and our partners can remember your settings, understand how you use GOV.UK and make improvements."
assert_select ".gem-c-cookie-banner__content", text: "We use cookies to collect information about how you use GOV.UK. Some of these are essential to make the site work.We'd like to set additional cookies to understand how you use GOV.UK, remember your settings and improve government services.We may also use cookies set by other sites to help us deliver content from their services."
assert_select 'button[data-hide-cookie-banner="true"]'
end

Expand Down Expand Up @@ -45,7 +44,7 @@ def component_name
it "renders a hide link within the confirmation banner" do
render_component({})

assert_select ".gem-c-cookie-banner__confirmation .gem-c-cookie-banner__hide-button", text: "Hide"
assert_select ".gem-c-cookie-banner__confirmation .gem-c-cookie-banner__hide-button", text: "Hide this message"
assert_select '.gem-c-cookie-banner__hide-button[data-module=track-click][data-track-category=cookieBanner][data-track-action="Hide cookie banner"]'
end

Expand Down

0 comments on commit 2ecd674

Please sign in to comment.