Modernize banner with backwards-compatible style=classic opt-out#356
Open
rainxchzed wants to merge 1 commit intokeepandroidopen:mainfrom
Open
Modernize banner with backwards-compatible style=classic opt-out#356rainxchzed wants to merge 1 commit intokeepandroidopen:mainfrom
rainxchzed wants to merge 1 commit intokeepandroidopen:mainfrom
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
This PR refreshes
public/banner.jswith a slimmer, more embeddable warning bar while preserving every existing query parameter, language string, and embed contract. Embedders who prefer the current look can pin to it with one new opt-in parameter:?style=classic.Why
prefers-color-scheme, which clashes with the growing number of dark-themed supporter sites.prefers-reduced-motionfallback and no RTL flow handling for Arabic / Hebrew / Persian embedders.What changes
prefers-reduced-motionfallback, and RTL mirroring (arrow flips,inset-inline-endeverywhere).aria-live="polite"status node updates once per day (not per tick) so screen readers aren't flooded by the countdown.What stays the same
lang,id,size,link,hidebutton,animation.<script src="…/banner.js">embed pattern — no markup changes on supporter sites.localStoragedismiss key (kao-banner-hidden) and 30-day re-show window.idorprepend(<body>)).var, string concatenation, no template literals, no arrow functions.Intl.NumberFormat({ style: "unit" })remains the highest floor.New optional params
themeauto|light|darkautostylemodern|classicmodernclassicrenders the pre-PR design 1:1Compatibility & rollout
style=classicpreserves the original look pixel-for-pixel — single-param opt-out for embedders. The classic block is namespaced under.kao-banner.kao-banner--style-classicand reuses the original CSS verbatim, so the red Arial-Black aesthetic is byte-faithful (verified visually side-by-side)..kao-banner.kao-banner--style-modernso they cannot leak into classic..kao-banner-closeand the new.kao-banner__closeclass hooks for any embedder CSS overrides in the wild.public/banner.js; no new assets, no build step, no breaking change to the embed contract.Try it
Verified locally
normal/mini/minimal) × both styles (modern/classic) × both themes (light/dark) ×theme=autounder both light and dark OS settings.dir="rtl": arrow flips, dismiss button mirrors to the start side.animation=offdisables the icon pulse (modern) and the box-shadow pulse (classic).hidebutton=offremoves the close button.link=noneremoves the CTA link in modern; preserves text-only behavior in classic.prefers-reduced-motion: reduce— animations replaced with static states.Open questions
style=classicbe the default for the first ~2 weeks (soft launch) before flipping the default tomodern? Happy to flip the ternary.position=top|inlineship in this PR, or land as a follow-up? It's not implemented here — kept the PR small.Closing
Fully open to your judgment here — the campaign's voice and visual urgency are yours to set, and we'd be glad to tune tokens (color, height, copy weight), drop sections, or pull the PR back entirely if the current design is serving the cause better. Thank you for keeping this banner maintained and easy to embed; happy to iterate on whatever direction is most useful.