Problem/Motivation

If you have the setting to reduce the motion activated in your operating system (in macOS you have to tick the "reduce motion" toggle under settings->accessibility->display) you still have the animation to expand or collapse the navigation sidebar when pressing the button in the lower left corner. That collapse/expansion triggers a shift and animation of the entire screen. For people with vestibular disorder, hyper-vigilance, and other focus related disorders can potentially be a trigger. i’ve asked @charles belov and he confirmed and provided some more context:

I cannot speak for all people with animation issues. Here is my reality:

- I have been triggered for vestibular disorder with surprisingly small screen areas. I believe it has to do with whether I am focusing on that area.

- It's not just about vestibular disorder, it's about hypervigilance and other focus disorders. Any animation can potentially trigger hypervigilance or disrupt focus.

- Further, enough animation has triggered unwanted physical effects for me that any unsolicited animation can be emotionally triggering. I believe that issue has lessened now that I'm using the workaround below and feel I have more control, but again I can't speak for others.

So the best practice would be if people indicate they don't want animation, only give them essential animation, only with a play/pause button, then default to pause. No cosmetic animation.

As a side note, "Reduce motion" is an artifact of Apple getting there first and calling it that. Windows and Android use language indicating it's all or nothing, even if they don't always follow it.

in a followup he also added:

There may be a fine line between hypervigilance and ADHD, or it may not matter, but people with either one can find animations distracting. For me, one issue is that the animation takes my attention away from my intended task and I have to re-focus on the task, which has a similar, if hopefully smaller, cost as multitasking does.

Steps to reproduce

Proposed resolution

Change the CSS selector for the existing reduced-motion rule so that it affects both the toolbar and the page content when they're moved.

the settings of the user should be respected, as charles summed it up nicely:

So the best practice would be if people indicate they don't want animation, only give them essential animation, only with a play/pause button, then default to pause. No cosmetic animation.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3542774

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rkoller created an issue. See original summary.

charles belov’s picture

With regard to my quote

I believe that issue has lessened now that I'm using the workaround below

I am using layout.frame_rate set to 3 in Firefox.

catch’s picture

Priority: Normal » Major

marcoliver made their first commit to this issue’s fork.

marcoliver’s picture

Status: Active » Needs review

Played around with this a bit and opened an MR.

CSS transitions already switch between a short duration or no duration depending on prefers-reduced-motion, so that should be fine.

In the end the only thing that seemed to require changing was the scope of the duration reset, because the body content was still being transitioned to the side when the navigation was expanded/collapsed.

So I changed the scope and now the content instantly moves into place.

I'm pretty sure I'm missing something here, because this seems like too easy a fix :-D

finnsky’s picture

Yes, we had a long history with variable scoping.
So the original work could very well have been lost.
And this could very well be a fix :)

I haven't tested it, so I'm leaving it as "Needs review"

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs screenshots

Applied the MR but when having "reduced motion" checked I'm not seeing any difference from before. Tagging for screenshots but really small videos would be super helpful for the review.

Also can the proposed solution be flushed out if we aren't wrapping the animation in a media query

Thanks!

marcoliver’s picture

I have attached two small videos of what I'm seeing (on macOS 26, in Safari, Firefox and Chrome) with Reduce Motion on in accessibility settings, before and after applying the selector change.

In the unchanged state the navigation pops into position immediately, but the body content to the right still does a little slide animation to the side.

catch’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs screenshots

Had a go at updating the issue summary, this looks good to me. Thanks for recording the videos.

finnsky’s picture

Thanks for your time here!

Yes, this is such a simple fix!

When we first started working on the module, we planned to be able to disable all animations with a single media query.

When the code was added to Drupal core, we apparently added a scope for this selector to avoid affecting other parts of the site.
But we probably did it incorrectly due to haste.

This scope isn't present in the original module code.
https://git.drupalcode.org/project/navigation/-/blob/1.x/css/base/variab...

I tested it locally and everything works as it should!

finnsky’s picture

Status: Needs review » Reviewed & tested by the community
catch’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • catch committed d04c92cb on 11.3.x
    fix: #3542774 The “reduce motion” setting in the operating system should...

  • catch committed 826972de on 11.x
    fix: #3542774 The “reduce motion” setting in the operating system should...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.