Skip to main content
Back to Guides
Customization5 min readBy Armin Zaribaf

Cookie Banners and OS Accessibility Settings

Your visitors already told their browser they want less motion, forced colours, or bigger text. Most cookie banners ignore all of it. Here's how to honour the settings people have already chosen.

Your visitors already told their browser how they want to see things

Someone with a vestibular disorder has turned on "reduce motion." Someone with low vision runs Windows in High Contrast Mode. Someone else bumped their browser text size up 40 percent. These aren't edge cases you have to guess at. The browser exposes every one of them to CSS, and most cookie banners ignore all of them, animating in, hard-coding their own colours, and clipping text the moment it grows. Honouring these signals is some of the cheapest accessibility work you'll ever do, because the user already did the hard part.

This guide covers four signals worth respecting. For the broader ruleset, start with Cookie Banner Accessibility.

Motion: honour prefers-reduced-motion

A banner that slides, bounces, or fades in looks polished until it reaches someone for whom motion triggers nausea or dizziness. The prefers-reduced-motion media query tells you when a visitor has asked their system to cut animation, and WCAG's Animation from Interactions criterion is satisfied by respecting it. The fix is a few lines: when reduced motion is requested, drop the transition and just show the banner.

The banner should still appear promptly either way. An animation that delays the reject button by 400 milliseconds is a small dark pattern of its own, and it also drags on interaction latency (see Core Web Vitals).

Forced colours: don't fight High Contrast Mode

When a user turns on Windows High Contrast Mode (or a similar forced-colours setting), the browser overrides page colours with a small palette the user chose. The forced-colors: active media query tells you it's on. The instinct to reassert your brand colours with !important is exactly wrong here. Work with the mode instead:

  • Keep borders. Forced colours strips background colours, so a filled button with no border can vanish into the page. Give buttons and the banner a border so they stay distinct when the fill disappears.
  • Don't carry meaning in a background image or gradient. If a coloured background is the only thing marking your primary action, that signal is gone in forced-colours mode. Back it with text and a shape.
  • Use system colour keywords where you adapt. CSS system colours like ButtonText and Canvas map to the user's chosen palette, so your banner reads as part of their environment rather than fighting it.
css
/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cb-banner { animation: none; transition: none; }
}

/* Survive forced-colours / High Contrast Mode */
@media (forced-colors: active) {
  .cb-banner,
  .cb-banner button {
    border: 1px solid ButtonText;   /* keeps the shape visible */
  }
}

/* Adapt contrast for dark mode */
@media (prefers-color-scheme: dark) {
  .cb-banner { background: #14181f; color: #e8ebef; }
}

Dark mode: the contrast that passes in light and fails in dark

A banner tuned for a white background can quietly fail on a dark one. Grey helper text at 4.6:1 on white might drop to 2.8:1 on your dark surface, under the 4.5:1 WCAG asks for normal text. The prefers-color-scheme query lets you ship a dark palette, but shipping it isn't the same as checking it. Re-measure contrast in both themes: body text and links at 4.5:1, large text and UI component borders and focus indicators at 3:1. The button that reads clearly in light mode is the one most likely to disappear in dark mode, so test the reject control specifically.

Text spacing and zoom: leave room to breathe

Some readers override spacing to make text legible. WCAG's Text Spacing criterion sets the bar your layout has to survive: line height at least 1.5 times the font size, spacing after paragraphs at least 2 times, letter spacing 0.12 times, word spacing 0.16 times, all applied with no loss of content. A banner with text crammed into a fixed-height bar will clip when those values go up. The same fragility shows at 200 percent zoom and in the 400 percent reflow case. Build the banner so its height follows its content, and none of this bites.

System accessibility checklist for banners

  • Disable entrance animation under prefers-reduced-motion

    Show the banner immediately instead of sliding or fading it in.

  • Keep borders on the banner and its buttons

    Filled shapes vanish in forced-colours mode without a border.

  • Don't carry meaning in background colour or images alone

    Back the primary action with text and a shape too.

  • Ship and re-measure a dark palette with prefers-color-scheme

    4.5:1 for text, 3:1 for borders and focus, checked in both themes.

  • Let banner height follow content, not a fixed value

    Survives text-spacing overrides, 200% zoom, and 400% reflow.

  • Never gate a consent action behind an animation or hover

    Accept, reject, and preferences must work the moment the banner loads.

7 min read

Keyboard Focus in Cookie Banners

Focus is the keyboard user's cursor, and cookie banners keep losing it: no focus on open, a trap with no exit, or a sticky bar hiding the very field the user just tabbed to. Here's how to get focus right.

6 min read

Cookie Banners That Survive Translation

A cookie banner designed in English tends to break the moment it's translated. German runs long, Arabic runs the other way, and buttons overflow. Here's how to design a layout that holds up.

7 min read

Designing an Accessible Cookie Preferences Center

The second layer of your banner, the granular settings panel, is where consent actually gets specific. Here's how to design the toggles, labels, defaults, and buttons so every visitor can operate it.

8 min read

How to Migrate from Cookiebot to CookieBeam (Step by Step)

A Cookiebot-specific migration guide: export consent records, map categories, remove Cookiebot's tag-based blocking, and cut over to CookieBeam's automatic script interception, connection-level blocking, and continuous drift detection without breaking Consent Mode or losing consent history.

5 min read

Consent Fatigue: Stop Re-Prompting Users and Losing Consent

When visitors see your banner every session, they stop reading and start reflex-clicking. Most over-prompting is a bug, not a design choice. Here's how to store consent for a sensible window, scope it right, and ask again only when the law requires it.