Skip to content

CSS: gate all transitions/animations behind prefers-reduced-motion #85

Open

Description

@johnhringiv

Context

Reduced-motion is handled for one component only — the lightning-fill animations (app.css ~L1498, prefers-reduced-motion: reduce → animation: none). Everything else always animates:

  • .btn transition incl. transform (~L518)
  • select/menu colour transitions (~L760, L876), tooltip fade (~L974), modal fade (~L1116)
  • stats chart chips/segments/reset (~L1565, L1624, L1665, L1715)
  • resources/js/toast.js sets an inline transition: opacity 0.3s for dismissal

Bootstrap 6 flips the default: transitions are emitted only inside @media (prefers-reduced-motion: no-preference); transition: none rules stay outside.

Proposed

  • Wrap transitions/animations in @media (prefers-reduced-motion: no-preference) (or the inverse reduce block covering everything, if fewer edits).
  • Add duration/easing tokens (--transition-duration, --transition-timing) — there are currently four different literal durations (0.1s/0.12s/0.2s/0.3s).
  • Move the toast fade from inline JS styles into CSS so it's covered too (see Toasts/tooltips: @starting-style entry + class-based exit instead of inline JS styles #93).
  • The D3 transitions in stats-charts.js could check matchMedia('(prefers-reduced-motion: reduce)') as well.

Inspired by the Bootstrap 6 alpha (migration guide) — not adopting Bootstrap, just borrowing the idea.

🤖 Generated with Claude Code

Activity

  1. added
    enhancement
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions