Skip to content

Commit

Permalink
Edit Post and Base Styles: Standardize reduced motion handling using …
Browse files Browse the repository at this point in the history
…media queries (#68427)

Co-authored-by: Infinite-Null <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
3 people authored Jan 3, 2025
1 parent 78e961d commit 19043c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
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

0 comments on commit 19043c9

Please sign in to comment.