Skip to content

Commit 2df037c

Browse files
committed
Add cookie banner
Once wired up, this will allow users to set their cookie preferences, initially just for Google Tag Manager tracking Cookie banners often link to a cookies page, but I've omitted that here to keep the change focused. It might be good to add an option to include this in future
1 parent 0471790 commit 2df037c

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

lib/assets/stylesheets/_govuk_tech_docs.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $govuk-new-link-styles: true;
1717
@import "govuk/core/index";
1818
@import "govuk/objects/index";
1919

20+
@import "govuk/components/cookie-banner/index";
2021
@import "govuk/components/footer/index";
2122
@import "govuk/components/header/index";
2223
@import "govuk/components/inset-text/index";

lib/source/layouts/core.erb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,28 @@
5252
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>
5353

5454
<div class="app-pane">
55+
<div class="govuk-cookie-banner" data-nosnippet role="region" aria-label="Cookies on <%= config[:tech_docs][:service_name] %>">
56+
<div class="govuk-cookie-banner__message govuk-width-container">
57+
<div class="govuk-grid-row">
58+
<div class="govuk-grid-column-two-thirds">
59+
<h2 class="govuk-cookie-banner__heading govuk-heading-m">
60+
Cookies on <%= config[:tech_docs][:service_name] %>
61+
</h2>
62+
<div class="govuk-cookie-banner__content">
63+
<p class="govuk-body">We’d like to use analytics cookies so we can understand how you use the service and make improvements.</p>
64+
</div>
65+
</div>
66+
</div>
67+
<div class="govuk-button-group">
68+
<button type="button" class="govuk-button" data-module="govuk-button">
69+
Accept analytics cookies
70+
</button>
71+
<button type="button" class="govuk-button" data-module="govuk-button">
72+
Reject analytics cookies
73+
</button>
74+
</div>
75+
</div>
76+
</div>
5577
<div class="app-pane__header toc-open-disabled">
5678
<a href="#content" class="govuk-skip-link" data-module="govuk-skip-link">Skip to main content</a>
5779

0 commit comments

Comments
 (0)