Safari’s Prefers‑Reduced‑Motion Bug: A Diagnostic & Fix Guide
Safari collapses animations on dropdowns, modals, and carousels when prefers‑reduced‑motion is active. This guide shows the symptom, root cause, ordered checks, CSS overrides, and escalation steps to keep UI fluid.
03 Aug 2026, 23:23 UTC

Recognizable Condition
In Safari, UI elements that normally animate—dropdown menus, modal fade‑ins, carousel slide‑ins—stop moving or collapse into a static state. The layout may shift, causing hidden content or broken spacing. The symptom appears only when the system setting “Reduce motion” is enabled or when the @media (prefers-reduced-motion: reduce) block is active.
Underlying Cause
Safari automatically applies the prefers-reduced-motion media query to all CSS animations and transitions, even if the developer tries to override them with specific animation-duration or transition-property values. Until Safari 16.1, the engine prioritized the media query over later declarations, and !important was required to force the desired duration.
Diagnostic Table
| # | Check | What to Look For |
|---|---|---|
| 1 | Open Web Inspector | Computed style shows animation-duration: 0s or transition-duration: 0s for the element. |
| 2 | Search CSS for @media (prefers-reduced-motion: reduce) | Block targets the problematic component. |
| 3 | Check Safari version | Version < 16.1 may require stricter overrides. |
| 4 | Toggle system Reduce motion setting | Re‑confirm that the issue persists only when enabled. |
Ordered Checks & Fixes
Inspect Computed Style
In Safari’s Web Inspector, select the element and view the Computed tab. Verify thatanimation-durationortransition-durationis0s. If so, proceed to the next step.Locate the Media Query
Search the stylesheet for@media (prefers-reduced-motion: reduce)that targets the element. Note anyanimation-duration: 0sortransition-duration: 0sdeclarations.Override with Specificity
Add a more specific rule that excludes the media query, e.g.:/* Only apply when the user does NOT request reduced motion */ @media (prefers-reduced-motion: no-preference) { .dropdown, .modal, .carousel { animation-duration: 0.4s !important; transition-duration: 0.4s !important; } }Using
!importanthere is acceptable because it is scoped to a narrow selector and a specific media query.Test with Reduced Motion Disabled
Disable the system setting (System Preferences > Accessibility > Reduce motion) and reload the page. The animation should run normally. If it does, the override is effective.Re‑enable Reduced Motion
Re‑enable the setting and verify that the animation still runs. If it collapses again, the override was not applied correctly.Fallback JavaScript (Optional)
For critical animations that must not collapse, add a small JS shim that re‑initializes the animation when Safari detects reduced motion:document.addEventListener('DOMContentLoaded', () => { const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)'); if (!prefersReducedMotion.matches) return; const elems = document.querySelectorAll('.critical-animation'); elems.forEach(el => el.classList.add('force-animate')); });In CSS, define
.force-animatewith the desired duration and animation‑name.
Escalation Criteria
- If the override works in a minimal test page but fails in the production site, check for third‑party libraries that inject conflicting CSS.
- If the element still collapses after all overrides, file a reproducible test case in WebKit Bugzilla and tag it “safari‑prefers‑reduced‑motion”.
- As a temporary workaround for a specific user group, consider disabling the system setting via a browser‑side toggle or a user‑agent CSS injection.
Practical Verification
Open Safari Web Inspector, inspect the element, and confirm
animation-durationis non‑zero.Toggle “Reduce motion” in System Preferences, reload the page, and verify the animation still runs.
Run a visual regression test (e.g., Applitools, Percy) against Safari 16.x to ensure consistent UI.
Document the override in the project’s style guide and note the Safari version requirement.
Limitations & Maintenance Notes
- Overusing
!importantcan create cascading issues; limit it to the narrow selector shown above. - Safari’s handling of
prefers-reduced-motioncan change in minor releases; keep the test environment synchronized with the target deployment version. - JavaScript fallbacks should be used sparingly and only for critical animations, as they add runtime overhead.
Summary
When Safari collapses UI animations under prefers-reduced-motion, the problem usually stems from the browser’s default enforcement of the media query. By locating the offending CSS, adding a specific override with !important inside a no‑preference media query, and optionally providing a JavaScript shim, you can restore the intended animation behavior. Verify the fix by toggling the system setting and using Safari’s Web Inspector. If the issue persists, report it to WebKit and consider temporary workarounds for affected users.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.