Skip to content

Commit

Permalink
Prevent text wrap on cookie notice button (#10763)
Browse files Browse the repository at this point in the history
Also expand saving of click from 30 to 90 days.

Before:

<img width="169" alt="Ok, got it button but text wrapped"
src="https://github.com/flutter/website/assets/18372958/6f12d9cf-4b5f-4e85-b341-0d91b6fadbdc">
  • Loading branch information
parlough authored Jun 19, 2024
1 parent 30aea0f commit fde9d6a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/_sass/components/_cookie-notice.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
padding-right: 1.5rem;
}

button {
text-wrap: nowrap;
}

&.show {
display: block;
animation-duration: 500ms;
Expand All @@ -41,7 +45,7 @@
p {
font-size: 1rem;
line-height: 1.6;
margin-right: 2rem;
margin-right: 1.5rem;
margin-bottom: 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/content/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function initCookieNotice() {

agreeBtn.addEventListener('click', (e) => {
e.preventDefault();
Cookies.set(cookieKey, cookieConsentValue, { sameSite: 'strict', expires: 30 });
Cookies.set(cookieKey, cookieConsentValue, { sameSite: 'strict', expires: 90 });
notice.classList.remove(activeClass);
});
}
Expand Down
1 change: 1 addition & 0 deletions tool/flutter_site/lib/src/commands/build.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ final class BuildSiteCommand extends Command<int> {
const ['eleventy'],
environment: {
'PRODUCTION': '$productionRelease',
'OPTIMIZE': '$productionRelease',
},
);

Expand Down

0 comments on commit fde9d6a

Please sign in to comment.