A thoughtful CSS accessibility audit checks contrast across real interface colors, keeps keyboard focus easy to see, and makes skip links useful. It also respects reduced-motion settings and includes checks with assistive technology, because small style details can shape how comfortably people use a site.

Multiple Choice

How would you design an accessibility audit for CSS that includes color contrast, focus states, and motion?

An effective CSS accessibility audit centers on readability, keyboard navigation, and motion behavior, with practical checks that reflect real usage. Checking color contrast ratios ensures text and UI elements meet WCAG thresholds so content remains legible for people with low vision or color differences. Making focus indicators clearly visible is essential for keyboard users to know which element is active as they tab through the page. Verifying skip links helps users who rely on keyboard navigation or screen readers jump straight to the main content, improving efficiency and reducing fatigue. Respecting reduced motion preferences means adapting or removing animations for those who are sensitive to motion, which reduces discomfort and potential disorientation. Testing with assistive technologies—screen readers, magnifiers, and keyboard-only workflows—helps confirm that these practices actually work in practice. Other options fall short because they miss critical accessibility needs: ignoring color contrast undermines readability; checking contrast only for text on white backgrounds ignores many real-world scenarios; and assuming accessibility is automatic neglects the actual work needed to accommodate diverse users.

Designing a CSS Accessibility Audit That Works in Real Life

A page can look polished and still be hard to use. Text may fade into its background, keyboard focus may disappear, or a smooth animation may leave someone feeling dizzy. These problems often hide in CSS, where a small visual choice can shape the whole experience of a site.

A useful CSS accessibility audit looks beyond whether a page appears neat on a designer’s screen. It checks whether people can read content, move through the page, and control motion in ways that suit them. That means checking color contrast, visible focus states, skip links, and reduced-motion behavior—and then testing the results with assistive technology.

Start with the people using the page

Accessibility work gets clearer when it begins with real ways of using a site. Some visitors use a mouse. Others rely on a keyboard, a screen reader, a magnifier, voice control, or a mix of tools. Many people switch methods depending on the setting. A person may use a keyboard at work, for instance, and a screen magnifier on a phone.

CSS affects each of these experiences. It can make text easier to read, show where keyboard focus has moved, or reduce visual motion. It can also cause trouble when styles hide content, remove focus outlines, or animate elements without considering user preferences.

So, before reviewing individual rules, define the audit’s scope. Include key page types, shared components, responsive layouts, and common states such as hover, focus, error, and expanded menus. A site’s home page might be accessible while its search panel or checkout flow is not. Shared components deserve special attention because one issue can appear across many pages.

Color contrast is more than black and white

Color contrast describes the difference in brightness between foreground and background colors. When that difference is too low, text and controls can become difficult to see, especially for people with low vision or color-vision differences. Bright sunlight, a dim screen, or an aging display can make low contrast harder for anyone.

Check the actual colors used in each state—not just the default view. A button may have readable text before a visitor hovers over it, then lose contrast when its background changes. Links can blend into body text if color is their only visual cue. Form labels, placeholder text, borders, icons, and disabled controls also deserve a look.

The Web Content Accessibility Guidelines (WCAG) set contrast targets for text and interface elements. For standard-sized text, WCAG 2.1 Level AA calls for a contrast ratio of at least 4.5:1. Large text has a lower minimum of 3:1. Certain interface components and meaningful graphics also need enough contrast against nearby colors. Check the current WCAG guidance for the exact criteria that apply to a given element.

A contrast checker can help, but it doesn’t replace judgment. Tools such as WebAIM’s Contrast Checker or browser-based accessibility inspectors can flag weak combinations. Use them on real page colors and include different backgrounds, themes, and component states. A pale gray label on white isn’t the only risk; a dark button with muted text, a colored banner, or text over an image can create the same problem.

Also, don’t rely on color alone to convey meaning. A red error message should include clear text or an icon with an accessible name. A chart should use labels or patterns, not just a set of colors. Color can support meaning, but it shouldn’t carry the whole message.

Keep keyboard focus easy to spot

When someone moves through a page with the Tab key, the browser shows which element is active. That visual cue is called a focus indicator. Without it, keyboard users can lose track of their place—like following a map after someone has erased the route.

Many sites remove the browser’s default outline to match a design. That can be fine only if a clear replacement is provided. A visible outline, underline, border, or background change can work, as long as it stands out against nearby colors and remains easy to see.

A simple CSS rule might look like this:


:focus-visible {

outline: 3px solid #1457d9;

outline-offset: 3px;

}

The :focus-visible selector can show a focus style when the browser determines that a visual cue is helpful, such as during keyboard navigation. Test it across the site, though. Focus styles can be clipped by containers, hidden beneath sticky headers, or made hard to see on certain backgrounds. Make sure they remain clear on links, buttons, form fields, menus, and custom controls.

Then move through the page using only a keyboard. Can you reach every interactive item? Does focus move in a sensible order? Can you see where you are? A screen reader can add another layer of insight, but a keyboard-only walkthrough is a quick and valuable first check.

Skip links save time—and effort

A skip link lets people bypass repeated navigation and move straight to the main content. It’s especially helpful for keyboard users who would otherwise need to tab through the same header links on every page.

Skip links are often hidden until they receive focus. That’s reasonable, but make sure the focused link becomes visible and easy to use. Its destination should also be meaningful. A link that jumps to a missing target, or lands behind a fixed header, doesn’t help much.

For example:


<a class="skip-link" href="#main-content">Skip to main content</a>

<main id="main-content">

<!-- Page content -->

</main>

The CSS should reveal the link when keyboard focus reaches it:


.skip-link {

position: absolute;

top: 1rem;

left: 1rem;

transform: translateY(-200%);

}

.skip-link:focus {

transform: translateY(0);

z-index: 1000;

}

Check the link on narrow screens and with browser zoom enabled. It shouldn’t be covered by a banner or vanish off-screen. Small details like these can make a long site feel far less tiring to navigate.

Let people reduce motion

Animation can add feedback and personality. A menu that opens smoothly may feel more natural than one that appears without transition. But motion can also trigger discomfort, headaches, nausea, or disorientation for some people.

CSS offers a way to respect a person’s motion preference through the prefers-reduced-motion media feature. A common approach is to reduce or remove non-essential transitions and animations:


@media (prefers-reduced-motion: reduce) {

*,

*::before,

*::after {

scroll-behavior: auto !important;

animation-duration: 0.01ms !important;

animation-iteration-count: 1 !important;

transition-duration: 0.01ms !important;

}

}

This kind of broad rule can be a useful starting point, but review its effect on the site. Some movement helps explain a change in state, and removing it without thought may make an interface less clear. The goal is to reduce motion that isn’t needed, while keeping important information available.

Test the site with the reduced-motion setting enabled in the operating system or browser. Check animated banners, parallax effects, auto-scrolling content, carousels, and transitions between views. A page that respects the setting should still work fully; it should simply avoid unnecessary motion.

Test beyond the stylesheet

CSS checks can catch many issues, but accessibility depends on how the whole page works. Test with a screen reader, a keyboard, and, where available, a magnifier. Tools such as NVDA, VoiceOver, and TalkBack can reveal whether content order and labels make sense. Automated scanners can spot some contrast or markup issues, but they can’t tell whether a focus indicator feels clear or whether a skip link lands in the right place.

Pair automated checks with human review. That combination matters. A report may show that a color ratio passes, while a person still finds the text hard to read in context. Likewise, a focus outline may technically exist but be nearly invisible against a patterned background.

Record findings in a way the team can act on: page or component, user impact, steps to reproduce, and a suggested fix. If the same issue appears across several pages, fix the shared component rather than patching every instance separately.

Make the audit part of ongoing maintenance

Accessibility isn’t a one-time cleanup. Styles change as teams add components, update color palettes, or adjust layouts for new screens. A small CSS change can bring back a contrast problem or remove a focus outline without anyone noticing.

Regular reviews help catch those regressions. Teams can include a brief accessibility check in design reviews and development stand-ups: mention new components, motion changes, or repeated issues that need attention. Keep the conversation specific and useful. “The menu’s focus state is hard to see on dark backgrounds” gives the team more to work with than “accessibility needs work.”

An effective audit is both technical and human. Measure contrast. Follow the focus path. Test skip links. Respect reduced-motion settings. Then use assistive technology to see whether those choices hold up in real use. CSS may shape what a page looks like, but a thoughtful audit helps ensure people can use it, too.