Sub topic 13
Visible focus, text zoom and reduced motion
This chapter assumes you can use DevTools to inspect computed styles and toggle states, and that you know the contrast check from the color chapter. Here you add three accessibility checks to a visual QA pass. Each one needs a different way of looking at the page than a normal side-by-side comparison.
Visible focus
Keyboard users move through a page with Tab. The browser draws a focus indicator on the element they are on. Designs often show only the default and hover states, so the focus style may be missing from the spec. Check the build anyway.
Press Tab from the top of the page and watch for these problems:
- An element receives focus but nothing visible changes. This is usually caused by
outline: nonewith no replacement. - The indicator is clipped by a parent with
overflow: hidden. - The focused element is hidden behind a sticky header or cookie banner.
- The indicator has less than 3:1 contrast against the background next to it.
- The tab order jumps around the page instead of following the visual order.
A safe baseline looks like this:
:focus-visible {
outline: 3px solid #1a5fb4;
outline-offset: 2px;
}:focus-visible shows the ring for keyboard focus and usually hides it for mouse clicks, so designers rarely object to it.
Text zoom
Browser zoom and text size are different settings. Browser zoom scales everything. Changing the browser's default font size, or using "Zoom text only" in Firefox, scales only text. Layouts built with fixed pixel heights often break under the second kind.
Test in three steps:
- Zoom to 200% and check that nothing is cut off or overlapping.
- Zoom to 400% on a 1280 px window. This is about 320 CSS px wide, so the page should reflow into a single column without horizontal scrolling (WCAG 1.4.10).
- Raise the default font size to "Very large" and reload. If body text does not grow, the CSS probably sets
font-sizeinpxonhtml. Usingremfixes this.
Watch for fixed-height buttons and cards where text spills out. Also check that sticky elements do not cover most of the viewport.
Reduced motion
Some users get dizziness or nausea from large animations such as parallax, auto-playing carousels and zooming transitions. They enable "reduce motion" in their operating system. Pages can detect this with a media query.
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}To test it without changing your system settings, open DevTools, press Ctrl/Cmd+Shift+P, run "Show Rendering", and set "Emulate CSS media feature prefers-reduced-motion" to reduce. Reload and trigger each animation.
Record each failure as a discrepancy, with the browser, zoom level or emulated setting included so a developer can reproduce it.
Exercise
You set the browser's default font size to "Very large", but the body text on the page stays the same size. What is the likely cause, and what is the fix?
Show answer
The CSS sets the font size in fixed pixels, often on the html or body element, so it ignores the user's default. Switch to relative units such as rem (or leave the root size unset) so text scales with the browser setting.