-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid using JavaScript by using server side cookie setting. JavaScript is only necessary for www.GOV.UK since it can't easily set cookies.
- Loading branch information
1 parent
de73133
commit 5f3a671
Showing
10 changed files
with
77 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.app-cookie-banner { | ||
@include govuk-font(16); | ||
@include govuk-text-colour; | ||
|
||
box-sizing: border-box; | ||
width: 100%; | ||
|
||
padding-top: govuk-spacing(3); | ||
padding-right: govuk-spacing(3); | ||
padding-bottom: govuk-spacing(3); | ||
padding-left: govuk-spacing(3); | ||
background-color: lighten(desaturate(govuk-colour("light-blue"), 8.46), 42.55); | ||
} | ||
|
||
.app-cookie-banner__message { | ||
margin: 0; | ||
@include govuk-width-container; | ||
} | ||
|
||
@include govuk-media-query($media-type: print) { | ||
.app-cookie-banner { | ||
display: none !important; | ||
} | ||
} |
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,7 @@ | ||
{% if shouldShowCookieMessage %} | ||
<div class="app-cookie-banner"> | ||
<p class="app-cookie-banner__message"> | ||
{{cookieText | safe }} | ||
</p> | ||
</div> | ||
{% endif %} |
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,7 @@ | ||
{% if shouldShowCookieMessage %} | ||
<div class="app-cookie-banner"> | ||
<p class="app-cookie-banner__message"> | ||
{{cookieText | safe }} | ||
</p> | ||
</div> | ||
{% endif %} |
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 |
---|---|---|
|
@@ -46,5 +46,8 @@ | |
"ignore": [ | ||
"nunjucks" | ||
] | ||
}, | ||
"devDependencies": { | ||
"cookie-parser": "^1.4.3" | ||
} | ||
} |
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