Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable animated transitions by default when prefers-reduced-motion: reduce #281

Merged
merged 8 commits into from
Feb 17, 2023
Merged
6 changes: 6 additions & 0 deletions packages/core/styles/common/variables.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,10 @@
--ifm-z-index-overlay: 400;
}

@media (prefers-reduced-motion: reduce) {
:root {
--ifm-transition-fast: 0ms;
}
}
slorber marked this conversation as resolved.
Show resolved Hide resolved

@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