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

Edit Widgets and Base Styles: Standardize reduced motion handling using media queries #68427

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions packages/base-styles/_animations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
}
}


animation: __wp-base-styles-fade-in $speed $easing $delay;
animation-fill-mode: forwards;
@include reduce-motion("animation");
@media not (prefers-reduced-motion) {
animation: __wp-base-styles-fade-in $speed $easing $delay;
animation-fill-mode: forwards;
}
}

@mixin animation__fade-out($speed: 0.08s, $delay: 0s, $easing: linear) {
Expand All @@ -30,10 +30,10 @@
}
}


animation: __wp-base-styles-fade-out $speed $easing $delay;
animation-fill-mode: forwards;
@include reduce-motion("animation");
@media not (prefers-reduced-motion) {
animation: __wp-base-styles-fade-out $speed $easing $delay;
animation-fill-mode: forwards;
}
}

// Deprecated
Expand Down
7 changes: 5 additions & 2 deletions packages/base-styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@
// Tabs, Inputs, Square buttons.
@mixin input-style__neutral() {
box-shadow: 0 0 0 transparent;
transition: box-shadow 0.1s linear;

@media not (prefers-reduced-motion) {
transition: box-shadow 0.1s linear;
}

border-radius: $radius-small;
border: $border-width solid $gray-600;
@include reduce-motion("transition");
}


Expand Down
5 changes: 3 additions & 2 deletions packages/edit-widgets/src/components/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@
}

svg {
transition: transform cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
@include reduce-motion("transition");
@media not (prefers-reduced-motion) {
transition: transform cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
}
}

&.is-pressed {
Expand Down
Loading