Skip to content

Commit

Permalink
💫 Respect reduced motion preference for tab animations
Browse files Browse the repository at this point in the history
  • Loading branch information
kierandrewett committed Jan 1, 2024
1 parent 344ea64 commit 23bde39
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions components/tabs/content/browser-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,20 +316,24 @@ class BrowserRenderedTab extends BrowserCustomizableArea {
* Determines how long to animate the tab for on open
*/
get _tabInAnimateDuration() {
return Services.prefs.getIntPref(
"dot.tabs.in_animation_duration_ms",
50
);
return gDot.prefersReducedMotion
? 0
: Services.prefs.getIntPref(
"dot.tabs.in_animation_duration_ms",
50
);
}

/**
* Determines how long to animate the tab for on close
*/
get _tabOutAnimateDuration() {
return Services.prefs.getIntPref(
"dot.tabs.out_animation_duration_ms",
30
);
return gDot.prefersReducedMotion
? 0
: Services.prefs.getIntPref(
"dot.tabs.out_animation_duration_ms",
30
);
}

get animationProps() {
Expand Down

0 comments on commit 23bde39

Please sign in to comment.