Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 11.7 — Accessible CSS
CSS · Example 3 of 3

Reduced motion and forced colours

In DevTools, open Rendering and emulate prefers-reduced-motion: reduce (the spinner slows down) and forced-colors: active (the custom box keeps a visible border, because shadows are removed in that mode).

CSS decides whether people can read, see where they are, and use a page comfortably: give text enough contrast, keep a clear focus indicator, hide text visually without hiding it from screen readers, survive forced-colours mode, and calm motion for people who ask for less.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 6 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Write a :focus-visible style for buttons that also stays visible in forced colours mode, even though the normal design uses a box-shadow ring.

02

Write CSS that turns off a .carousel slide animation for users who prefer reduced motion.

03

Write a .visually-hidden class and use it to label a search button that only shows a magnifying-glass icon.

Explain it without notes

01

What contrast ratios does WCAG AA require, and for what?

02

Why is outline: none harmful, and how do you style focus properly?

03

How do you hide text visually but keep it for screen readers? Why not display: none?

04

What is forced colours mode, and how should CSS handle it?

05

How should CSS respond to prefers-reduced-motion?

Reduced motion and forced colours

Preview

Press Run to see the page.

Console

Nothing logged yet.