Skip to content

Feature Request: Add support for 'prefers-reduced-motion' #12

@fellyph

Description

@fellyph

Problem Statement

Animations and motion effects can be visually distracting or even cause physical discomfort (e.g., motion sickness, vestibular disorders) for some users. The current scroll-driven animations in the plugin do not respect the user's operating system preference for reduced motion, potentially leading to a poor user experience for these individuals.

Proposed Solution

Implement support for the prefers-reduced-motion media query to disable or significantly reduce scroll-driven animations when a user has this preference enabled in their operating system settings.

This can be achieved by:

  1. CSS-only Approach: Utilizing @media (prefers-reduced-motion: reduce) in the CSS to override animation properties. This is the most efficient method given the project's pure-CSS animation strategy.
  2. Conditional Class/Attribute: Adding a class or data attribute to the body or animated elements when prefers-reduced-motion is detected (if JavaScript is necessary for other parts of the system, though ideally this would be CSS-driven).

The ideal solution would leverage pure CSS to respond to this media query, aligning with the project's existing animation philosophy.

Documentation Reference

For more information on prefers-reduced-motion and its implementation, please refer to:
https://web.dev/articles/prefers-reduced-motion

Acceptance Criteria

  • When a user has prefers-reduced-motion: reduce enabled in their OS settings, all scroll-driven animations (including parallax and other effects) provided by this plugin should be either:
    • Completely disabled, or
    • Replaced with a significantly simpler, non-moving effect (e.g., a simple fade-in instead of a slide-in or scale-up).
  • The implementation should primarily use CSS to respect the prefers-reduced-motion media query.
  • The change should be tested on platforms that support prefers-reduced-motion (e.g., macOS, Windows).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions