Skip to content

Commit

Permalink
feat: disable animated transitions by default when `prefers-reduced-m…
Browse files Browse the repository at this point in the history
…otion: reduce` (#281)

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
  • Loading branch information
Mysterious-Dev and slorber authored Feb 17, 2023
1 parent ef74848 commit 8572861
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions packages/core/styles/common/variables.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,11 @@
--ifm-z-index-overlay: 400;
}

@media (prefers-reduced-motion: reduce) {
:root {
--ifm-transition-fast: 0ms;
--ifm-transition-slow: 0ms;
}
}

@custom-media --ifm-narrow-window (max-width: 996px);
6 changes: 4 additions & 2 deletions packages/core/styles/components/navbar.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ html[data-theme='dark'],
transform: translate3d(-100%, 0, 0);
visibility: hidden;
width: var(--ifm-navbar-sidebar-width);
@mixin transition opacity visibility transform, 250ms, ease-in-out;
@mixin transition opacity visibility transform, var(--ifm-transition-fast),
ease-in-out;

&--show {
^&,
Expand All @@ -238,7 +239,8 @@ html[data-theme='dark'],
right: 0;
top: 0;
visibility: hidden;
@mixin transition opacity visibility, 100ms, ease-in-out;
@mixin transition opacity visibility, var(--ifm-transition-fast),
ease-in-out;
}

&__brand {
Expand Down

0 comments on commit 8572861

Please sign in to comment.