Motion can clarify state changes, but large movements and long transitions can make an interface uncomfortable for people who ask their system for less motion. CSS reads that preference through prefers-reduced-motion so decorative movement can stop while content and controls remain available.

The reduce value reflects the user's reduced-motion setting. Overrides placed after the normal motion rules can disable an entrance animation and a moving hover effect without changing the component's layout. The base styles must leave the content visible when the animation does not run.

Reduced motion still needs visible feedback. A disclosure card can keep its background change, keyboard focus outline, and expandable text while staying still. Chrome's Rendering panel can emulate the preference for testing without changing the operating system's accessibility settings.

Steps to respect reduced motion with CSS:

  1. Create a file named index.html in your text editor with a disclosure card linked to styles.css.
    index.html
    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>Reduced motion</title>
      <link rel="stylesheet" href="styles.css">
    </head>
    <body>
      <h1>Less motion, same content</h1>
      <p>A card can stay useful without moving.</p>
      <details class="motion-card">
        <summary>Show details</summary>
        <p>Details stay available without movement.</p>
      </details>
    </body>
    </html>
  2. Create styles.css in the same folder with the card's appearance and normal motion rules.
    styles.css
    body {
      margin: 2rem;
      font: 1rem/1.5 system-ui, sans-serif;
      color: #172b4d;
      background: #f4f7fb;
    }
     
    .motion-card {
      padding: 1.25rem;
      border: 2px solid #56749c;
      border-radius: 0.75rem;
      background: white;
      animation: arrive 700ms ease-out;
    }
     
    summary {
      width: fit-content;
      padding: 0.5rem;
      cursor: pointer;
      transition: transform 240ms ease;
    }
     
    summary:hover,
    summary:focus-visible {
      transform: translateY(-0.4rem);
      background: #e0edff;
    }
     
    summary:focus-visible {
      outline: 3px solid #2563eb;
      outline-offset: 4px;
    }
     
    @keyframes arrive {
      from { transform: translateY(1rem); }
      to { transform: translateY(0); }
    }

    The card enters once, and Show details rises on hover or keyboard focus. Its normal position, text, and focus outline do not depend on the animation completing.

  3. Append the reduced-motion overrides at the end of styles.css.
    styles.css
    @media (prefers-reduced-motion: reduce) {
      .motion-card { animation: none; }
      summary { transition: none; }
      summary:hover,
      summary:focus-visible { transform: none; }
    }

    Removing the transition alone would still leave an instant jump from the transform. Overriding both keeps the control stationary, while the background and focus outline remain active. A blanket override for every element could interfere with unrelated components.

  4. Save both files in the same folder.
  5. Open index.html in Chrome.

    The address bar shows the saved file's location; the folder depends on where you saved it. No web server or JavaScript is needed.

  6. Focus Show details with the Tab key.

    Without a reduced-motion request, the label rises slightly and gains a blue outline. With reduced motion already enabled, it stays still and keeps the outline. There is no need to disable an accessibility setting to test the card.

  7. Open Chrome DevTools with F12, or Command+Option+I on macOS.
  8. Open the DevTools Command Menu with Ctrl+Shift+P on Windows or Linux, or Command+Shift+P on macOS.
  9. Run Show Rendering from the Command Menu.
  10. Select prefers-reduced-motion: reduce under Emulate CSS media feature prefers-reduced-motion in the Rendering panel.

    The control may be farther down the panel. The media query updates immediately; entrance animations are also disabled on subsequent reloads.

  11. Focus Show details in the page with the Tab key.

    A click on blank page space returns keyboard input to the page if DevTools still has focus. The label should keep its blue outline without rising.

  12. Expand Show details with Enter.
  13. Confirm that the details text is visible beneath the stationary, outlined control with reduced motion enabled.

    Details stay available without movement. should appear inside the card. Missing text, a moving label, or a lost keyboard focus outline means the reduced-motion styling has removed more than the motion or has not overridden the original rule.

Share this guide