Skip to content

Full Redesign

A production-ready, fully custom banner skin — token overrides, class-level tweaks, animated entrance, dark mode, and a line-by-line compliance audit at the end.

Show what is possible when you combine every technique from the earlier recipes into a single coherent CSS file. The result is a banner that looks nothing like the Kookiok default, yet passes all 18 compliance rules because none of the legally required elements are hidden, obscured, or de-emphasised.

This is an advanced starting point for teams that want full visual ownership of the consent UI.

custom.css
/* ════════════════════════════════════════════════════════
Kookiok Banner — Full Redesign
Theme: Midnight Forest (dark green + sand)
Author: replace-me
Date: 2026-05-18
════════════════════════════════════════════════════════ */
/* ── 1. Self-hosted font ───────────────────────────────── */
@font-face {
font-family: 'DMSans';
src: url('https://cdn.example.com/fonts/DMSans-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'DMSans';
src: url('https://cdn.example.com/fonts/DMSans-SemiBold.woff2') format('woff2');
font-weight: 600;
font-style: normal;
font-display: swap;
}
/* ── 2. Design tokens ──────────────────────────────────── */
.ag-banner {
/* Palette */
--surface: #0f1a13; /* deep forest green */
--surface-text: #e8f0e9; /* pale mint */
--surface-text-muted: #8aaa8e; /* muted sage */
--accent: #4ade80; /* lime-400 */
--btn-fill: #16a34a; /* green-600 */
--btn-text: #ffffff;
--link: #86efac; /* green-300 */
--border: #1e3124;
--shadow: 0 8px 40px 0 rgba(0, 0, 0, 0.6);
/* Shape */
--radius: 12px;
--radius-card: 20px;
/* Typography */
--font-family: 'DMSans', system-ui, sans-serif;
--font-size-base: 0.9375rem; /* 15 px */
/* Motion */
--animation: ag-forest-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* ── 3. Entrance animation ─────────────────────────────── */
@keyframes ag-forest-rise {
from { opacity: 0; transform: translateY(16px) scale(0.98); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
.ag-banner {
animation: var(--animation);
}
/* ── 4. Inner layout ───────────────────────────────────── */
.ag-banner .ag-banner-inner {
background: var(--surface);
color: var(--surface-text);
border: 1px solid var(--border);
padding: 28px 28px 24px;
}
/* ── 5. Title ──────────────────────────────────────────── */
.ag-banner .ag-title {
font-size: 1.125rem;
font-weight: 600;
letter-spacing: -0.01em;
margin-bottom: 10px;
}
/* ── 6. Description text ───────────────────────────────── */
.ag-banner .ag-desc {
font-size: var(--font-size-base);
color: var(--surface-text-muted);
line-height: 1.55;
margin-bottom: 20px;
}
/* ── 7. Buttons ────────────────────────────────────────── */
.ag-banner .ag-btn {
border-radius: var(--radius);
font-weight: 600;
letter-spacing: 0.01em;
transition: background 0.15s, transform 0.1s;
}
.ag-banner .ag-btn:hover {
transform: translateY(-1px);
}
.ag-banner .ag-btn:active {
transform: translateY(0);
}
/* ── 8. Links / secondary actions ──────────────────────── */
.ag-banner .ag-links {
border-top: 1px solid var(--border);
padding-top: 12px;
}
.ag-banner .ag-link {
color: var(--link);
text-decoration: underline;
text-underline-offset: 2px;
}
/* ── 9. Dark mode (same tokens, no change needed here) ─── */
/* The base palette is already dark. For a light-mode variant,
swap --surface to a light value and add a dark @media block. */
/* ── 10. Compact mobile ─────────────────────────────────── */
@media (max-width: 480px) {
.ag-banner .ag-banner-inner {
padding: 18px;
}
.ag-banner .ag-btns {
flex-direction: column;
gap: 8px;
}
.ag-banner .ag-btn {
width: 100%;
justify-content: center;
}
}
/* ── 11. Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
.ag-banner {
--animation: none;
animation: none;
}
.ag-banner .ag-btn {
transition: none;
}
}
classic · dialog · center

The CSS is structured in eleven numbered sections:

  1. Self-hosted font — declares DM Sans from your CDN. No Google Fonts CDN.
  2. Design tokens — all palette, shape, and typography values in one block. Edit here to re-theme.
  3. Entrance animation — a gentle rise and scale, 0.4 s.
  4. Inner layout — .ag-banner-inner gets dark background, mint text, subtle border. (.ag-banner-inner is the direct layout wrapper; there is no separate .ag-surface element.)
  5. Title — larger, semi-bold, tight tracking via .ag-title.
  6. Description text — smaller, muted sage color, generous line-height via .ag-desc. (Not .ag-body — the real selector is .ag-desc.)
  7. Buttons — inherit token radius; semi-bold labels; subtle hover lift via .ag-btn.
  8. Links — .ag-links gets a top border divider; individual .ag-link anchors are styled green-300 for readable contrast on the dark surface. (Not .ag-footer — the real selectors are .ag-links and .ag-link.)
  9. Dark mode — the base palette is already dark; light-mode visitors on dark-theme browsers see the same design. A light variant would go here.
  10. Compact mobile — stacked full-width buttons via .ag-btns, reduced padding on .ag-banner-inner.
  11. Reduced motion — removes entrance animation and button transitions.
#CheckResult
1Reject All is visible — #ag-reject-all is not hidden, not display: none, not opacity < 1✅ No rule targets this ID
2Button equal weight — Accept and Reject share the same --btn-fill, --btn-text, border-radius, and font-weight via .ag-btn (not differentiated by ID)✅ Only .ag-btn (shared) is targeted
3Contrast ≥ 4.5:1 — --surface-text (#e8f0e9) on --surface (#0f1a13): ratio ≈ 14:1; --btn-text (#fff) on --btn-fill (#16a34a): ratio ≈ 4.8:1✅ Both pass WCAG AA
4No branding modification — .ag-branding, .ag-cookie-mark, .ag-bite, .ag-cr1-3 not referenced✅ Absent from CSS
5Animations ≤ 0.5 s — entrance is 0.4 s; button hover transition is 0.15 s✅ Both under limit
6Reduced motion opt-out present — @media (prefers-reduced-motion: reduce) disables all motion✅ Block exists
7Mobile Reject visible — mobile block uses flex-direction: column, all buttons remain visible and full-width✅ No button hidden

All 7 checks pass. Deploy with confidence.

Light variant — change the token block to a light palette and add a dark @media block as shown in the Dark Mode Override recipe.

Different accent — swap --accent and --btn-fill to any hue; verify contrast before deploying.