Skip to content

New colour for cookie banner to improve ux readability #6283

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
41 changes: 23 additions & 18 deletions tyk-docs/assets/scss/_cookie.scss
Original file line number Diff line number Diff line change
@@ -7,11 +7,11 @@
bottom: -100%;
left: 0;
right: 0;
background: $brand-light-green;
color: #03031c;
padding: 0 32px;
background: $banner-dark-purple;
color: $white;
padding: 0;
box-shadow: 0 -2px 16px rgba(47, 54, 64, 0.39);

z-index: 1000;
transition: 400ms;
}

@@ -20,38 +20,43 @@
}

.cookie-container a {
color: #444444;
color: $cookie-banner-green;
text-decoration: underline;
}

.cookie-btn1 {
background: $white;
color: $brand-black;
padding: 9px 12px;
font-size: 13px;
margin-bottom: 16px;
background: $cookie-banner-green;
color: $banner-dark-purple;
padding: 8px 16px;
font-size: 11px;
cursor: pointer;
border-radius: 20px;
text-transform: uppercase;
font-weight: 700;
border: none;
letter-spacing: 0.5px;
min-width: 80px;
margin: 0;
}

.cookie-btn1:hover{
background-color: #cbcccb;
background-color: #00c5a9;
}

.cookie-btn2 {
background: $brand-light-green;
background: transparent;
color: $white;
padding: 9px 12px;
font-size: 13px;
margin-bottom: 16px;
padding: 8px 16px;
font-size: 11px;
cursor: pointer;
border-radius: 20px;
border: solid 2px $white;
border: solid 1px $white;
text-transform: uppercase;
font-weight: 700;
letter-spacing: 0.5px;
min-width: 80px;
margin: 0;
}
.cookie-btn2:hover{
background-color: #00ae94;
}
background-color: rgba(255, 255, 255, 0.1);
}
2 changes: 2 additions & 0 deletions tyk-docs/assets/scss/_variables.scss
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@ $brandpurple-dark: #8438fa;
$brandpurple-light: #e3ceff;
$brand-black: #03031c;
$brand-light-green: #20edba;
$cookie-banner-green: #00D9BA;
$banner-dark-purple: #1A0F40;

$white: #fff;
$black: #000;
5 changes: 4 additions & 1 deletion tyk-docs/static/js/cookie.js
Original file line number Diff line number Diff line change
@@ -3,11 +3,14 @@ const cookieButton1 = document.querySelector(".cookie-btn1");
const cookieButton2 = document.querySelector(".cookie-btn2");


// ACCEPT button
cookieButton1.addEventListener("click", () => {
cookieContainer.classList.remove("active");
localStorage.setItem("cookieBannerDisplayed", "true");
localStorage.setItem("cookieAccepted", "true");
});

// REJECT button
cookieButton2.addEventListener("click", () => {
cookieContainer.classList.remove("active");
localStorage.setItem("cookieBannerDisplayed", "true");
@@ -18,4 +21,4 @@ setTimeout(() => {
if (!localStorage.getItem("cookieBannerDisplayed")) {
cookieContainer.classList.add("active");
}
}, 200);
}, 200);
20 changes: 9 additions & 11 deletions tyk-docs/themes/tykio/layouts/partials/cookie_notice.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
<div class="cookie-container">
<div class="container" style="display: flex; flex-direction: row; padding: 30px 30px 20px;">
<div style="width: 60%; text-align: left;">
<span style="font-family: 'Inter',sans-serif; font-weight: 300; font-size: 16px;">
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.
<div class="container" style="display: flex; flex-direction: row; padding: 12px 20px; align-items: center;">
<div style="width: 75%; text-align: left;">
<span style="font-family: 'Inter',sans-serif; font-weight: 400; font-size: 13px;">
We use cookies to make this website better, improve your experience and offer you personalised content. If you wish to opt-out from the use of cookies please see our <a href="https://tyk.io/privacy-policy/" target="_blank"><b>Cookies Policy</b></a>.
</span>
</div>
<div style="width: 40%; text-align: right;">
<button class="cookie-btn1" style="padding: 10px 30px;">
Accept
<div style="width: 25%; text-align: right;">
<button class="cookie-btn1" style="margin-right: 10px;">
ACCEPT
</button>
<button class="cookie-btn2" style="padding: 10px 30px;">
Reject
<button class="cookie-btn2">
REJECT
</button>
&nbsp;&nbsp;
<a href="https://tyk.io/privacy-policy/" target="_blank"><b>Read More</b></a>
</div>
</div>
</div>