diff --git a/packages/block-directory/src/components/downloadable-block-list-item/style.scss b/packages/block-directory/src/components/downloadable-block-list-item/style.scss index e13e46ef8d8786..77a75e765c9a49 100644 --- a/packages/block-directory/src/components/downloadable-block-list-item/style.scss +++ b/packages/block-directory/src/components/downloadable-block-list-item/style.scss @@ -16,6 +16,7 @@ border: 0; text-align: left; transition: box-shadow 0.1s linear; + @include reduce-motion("transition"); // The item contains absolutely positioned items. // Set `position: relative` on the parent to prevent overflow issues diff --git a/packages/block-editor/src/components/block-draggable/style.scss b/packages/block-editor/src/components/block-draggable/style.scss index f716f2d32a1d40..139650c644a5ce 100644 --- a/packages/block-editor/src/components/block-draggable/style.scss +++ b/packages/block-editor/src/components/block-draggable/style.scss @@ -60,6 +60,7 @@ align-items: center; background-color: transparent; transition: all 0.1s linear 0.1s; + @include reduce-motion("transition"); .block-editor-block-draggable-chip__disabled-icon { width: $grid-unit-50 * 0.5; diff --git a/packages/block-editor/src/components/block-list/content.scss b/packages/block-editor/src/components/block-list/content.scss index cd517fced833ef..1a882eee4d2f5c 100644 --- a/packages/block-editor/src/components/block-list/content.scss +++ b/packages/block-editor/src/components/block-list/content.scss @@ -401,6 +401,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b margin-left: -1px; margin-right: -1px; transition: background-color 0.3s ease; + @include reduce-motion("transition"); display: flex; align-items: center; justify-content: center; diff --git a/packages/block-editor/src/components/block-pattern-setup/style.scss b/packages/block-editor/src/components/block-pattern-setup/style.scss index 10582a7a2ce496..d5b90a517b47a8 100644 --- a/packages/block-editor/src/components/block-pattern-setup/style.scss +++ b/packages/block-editor/src/components/block-pattern-setup/style.scss @@ -131,6 +131,7 @@ margin: auto; padding: 0; transition: transform 0.5s, z-index 0.5s; + @include reduce-motion("transition"); z-index: z-index(".block-editor-block-pattern-setup .pattern-slide"); &.active-slide { diff --git a/packages/block-editor/src/components/block-switcher/style.scss b/packages/block-editor/src/components/block-switcher/style.scss index 62a7bebe95d278..1a1950d8941f48 100644 --- a/packages/block-editor/src/components/block-switcher/style.scss +++ b/packages/block-editor/src/components/block-switcher/style.scss @@ -130,6 +130,7 @@ height: 100%; border-radius: $radius-small; transition: all 0.05s ease-in-out; + @include reduce-motion("transition"); position: relative; border: $border-width solid transparent; diff --git a/packages/block-editor/src/components/block-tools/style.scss b/packages/block-editor/src/components/block-tools/style.scss index 35d075c1a99b78..d4c3eb31ecf222 100644 --- a/packages/block-editor/src/components/block-tools/style.scss +++ b/packages/block-editor/src/components/block-tools/style.scss @@ -194,6 +194,7 @@ // Use a minimal duration to delay hiding the element, see hide-during-dragging animation for more details. // It's essential to hide the toolbar/popover so that `dragEnter` events can pass through them to the underlying elements. animation: hide-during-dragging 1ms linear forwards; + @include reduce-motion("animation"); } .block-editor-block-parent-selector { diff --git a/packages/block-editor/src/components/button-block-appender/content.scss b/packages/block-editor/src/components/button-block-appender/content.scss index f5486d3f6f6086..8bc746423bea08 100644 --- a/packages/block-editor/src/components/button-block-appender/content.scss +++ b/packages/block-editor/src/components/button-block-appender/content.scss @@ -80,6 +80,7 @@ box-shadow: inset 0 0 0 $border-width $light-gray-placeholder; color: $light-gray-placeholder; transition: background-color 0.2s ease-in-out; + @include reduce-motion("transition"); @media ( prefers-reduced-motion: reduce ) { transition: none; diff --git a/packages/block-editor/src/components/global-styles/style.scss b/packages/block-editor/src/components/global-styles/style.scss index e0782fdb01b1d0..5558858ebec050 100644 --- a/packages/block-editor/src/components/global-styles/style.scss +++ b/packages/block-editor/src/components/global-styles/style.scss @@ -55,6 +55,7 @@ transform: scale(1); transition: transform 0.1s ease; will-change: transform; + @include reduce-motion("transition"); &:focus { border: #{ $border-width * 2 } solid $gray-700; diff --git a/packages/block-editor/src/components/iframe/content.scss b/packages/block-editor/src/components/iframe/content.scss index 05bbdb25c2dc63..d843a0c87fb95c 100644 --- a/packages/block-editor/src/components/iframe/content.scss +++ b/packages/block-editor/src/components/iframe/content.scss @@ -6,6 +6,7 @@ transform-origin: top center; // Prevents a flash of background color change when entering/exiting zoom out transition: background-color 400ms; + @include reduce-motion("transition"); &.zoom-out-animation { $scroll-top: var(--wp-block-editor-iframe-zoom-out-scroll-top, 0); diff --git a/packages/block-editor/src/components/link-control/style.scss b/packages/block-editor/src/components/link-control/style.scss index 16493e1a5aa7f0..b961646ff8c550 100644 --- a/packages/block-editor/src/components/link-control/style.scss +++ b/packages/block-editor/src/components/link-control/style.scss @@ -291,6 +291,7 @@ $block-editor-link-control-number-of-actions: 1; border-radius: 100%; animation: loadingpulse 1s linear infinite; animation-delay: 0.5s; // avoid animating for fast network responses + @include reduce-motion("animation"); } } } diff --git a/packages/block-editor/src/components/list-view/style.scss b/packages/block-editor/src/components/list-view/style.scss index 3529c27b56e24f..082dd5158a5592 100644 --- a/packages/block-editor/src/components/list-view/style.scss +++ b/packages/block-editor/src/components/list-view/style.scss @@ -234,6 +234,7 @@ margin: 0; text-decoration: none; transition: box-shadow 0.1s linear; + @include reduce-motion("transition"); .components-modal__content & { padding-left: 0; diff --git a/packages/block-library/src/image/style.scss b/packages/block-library/src/image/style.scss index 8ca5795cfd911a..890cb1a7a52ec4 100644 --- a/packages/block-library/src/image/style.scss +++ b/packages/block-library/src/image/style.scss @@ -18,6 +18,7 @@ &.show { animation: show-content-image 0.4s; + @include reduce-motion("animation"); } } } @@ -168,6 +169,7 @@ padding: 0; border-radius: 4px; transition: opacity 0.2s ease; + @include reduce-motion("transition"); &:focus-visible { outline: 3px auto rgb(90 90 90 / 25%); @@ -281,6 +283,7 @@ &.active { visibility: visible; animation: both turn-on-visibility 0.25s; + @include reduce-motion("animation"); img { animation: both turn-on-visibility 0.35s; } @@ -288,6 +291,7 @@ &.show-closing-animation { &:not(.active) { animation: both turn-off-visibility 0.35s; + @include reduce-motion("animation"); img { animation: both turn-off-visibility 0.25s; } @@ -302,6 +306,7 @@ animation: none; .lightbox-image-container { animation: lightbox-zoom-in 0.4s; + @include reduce-motion("animation"); // Override fade animation for image img { animation: none; @@ -309,6 +314,7 @@ } .scrim { animation: turn-on-visibility 0.4s forwards; + @include reduce-motion("animation"); } } &.show-closing-animation { @@ -316,6 +322,7 @@ animation: none; .lightbox-image-container { animation: lightbox-zoom-out 0.4s; + @include reduce-motion("animation"); // Override fade animation for image img { animation: none; @@ -323,6 +330,7 @@ } .scrim { animation: turn-off-visibility 0.4s forwards; + @include reduce-motion("animation"); } } } diff --git a/packages/block-library/src/navigation/style.scss b/packages/block-library/src/navigation/style.scss index 5f49eba466a5fd..91bd67079b2300 100644 --- a/packages/block-library/src/navigation/style.scss +++ b/packages/block-library/src/navigation/style.scss @@ -168,6 +168,7 @@ $navigation-icon-size: 24px; opacity: 0; transition: opacity 0.1s linear; visibility: hidden; + @include reduce-motion("transition"); // Don't take up space when the menu is collapsed. width: 0; diff --git a/packages/components/src/animate/style.scss b/packages/components/src/animate/style.scss index 1d64423e42f1f0..f7ec41a2b0b682 100644 --- a/packages/components/src/animate/style.scss +++ b/packages/components/src/animate/style.scss @@ -50,6 +50,7 @@ .components-animate__loading { animation: components-animate__loading 1.6s ease-in-out infinite; + @include reduce-motion("animation"); } @keyframes components-animate__loading { diff --git a/packages/components/src/button/style.scss b/packages/components/src/button/style.scss index 460aeaa2781cdf..a31fd87f9f0b7f 100644 --- a/packages/components/src/button/style.scss +++ b/packages/components/src/button/style.scss @@ -276,11 +276,7 @@ &.is-secondary.is-busy:disabled, &.is-secondary.is-busy[aria-disabled="true"] { animation: components-button__busy-animation 2500ms infinite linear; - // This should be refactored to use the reduce-motion("animation") mixin - // as soon as https://github.com/WordPress/gutenberg/issues/55566 is closed. - @media (prefers-reduced-motion: reduce) { - animation-duration: 0s; - } + @include reduce-motion("animation"); background-size: 100px 100%; /* stylelint-disable -- Disable reason: This function call looks nicer when each argument is on its own line. */ background-image: linear-gradient( diff --git a/packages/components/src/drop-zone/style.scss b/packages/components/src/drop-zone/style.scss index d66eaee87b8a1f..b2df0cebf4ef77 100644 --- a/packages/components/src/drop-zone/style.scss +++ b/packages/components/src/drop-zone/style.scss @@ -47,6 +47,7 @@ opacity: 1; transition: opacity 0.2s ease-in-out; + @include reduce-motion("transition"); @media (prefers-reduced-motion) { transition: none; } diff --git a/packages/edit-site/src/components/editor-canvas-container/style.scss b/packages/edit-site/src/components/editor-canvas-container/style.scss index 07d666fb293c59..ab83b283d3377d 100644 --- a/packages/edit-site/src/components/editor-canvas-container/style.scss +++ b/packages/edit-site/src/components/editor-canvas-container/style.scss @@ -27,6 +27,7 @@ right: 0; top: 0; transition: all 0.3s; // Match .block-editor-iframe__body transition. + @include reduce-motion("transition"); } .edit-site-editor-canvas-container__close-button { diff --git a/packages/edit-site/src/components/layout/style.scss b/packages/edit-site/src/components/layout/style.scss index 2c7e6ce1b10c8b..6967c463061451 100644 --- a/packages/edit-site/src/components/layout/style.scss +++ b/packages/edit-site/src/components/layout/style.scss @@ -116,6 +116,7 @@ .edit-site-resizable-frame__inner-content { box-shadow: $elevation-x-small; transition: border-radius, box-shadow 0.4s; + @include reduce-motion("transition"); // This ensure the radius work properly. overflow: hidden; diff --git a/packages/nux/src/components/dot-tip/style.scss b/packages/nux/src/components/dot-tip/style.scss index 3ab0c1a540fd5a..720e24b9ad3c18 100644 --- a/packages/nux/src/components/dot-tip/style.scss +++ b/packages/nux/src/components/dot-tip/style.scss @@ -13,6 +13,7 @@ $dot-scale: 3; // How much the pulse animation should scale up by in size &::before { animation: nux-pulse 1.6s infinite cubic-bezier(0.17, 0.67, 0.92, 0.62); + @include reduce-motion("animation"); background: rgba(#00739c, 0.9); opacity: 0.9; height: $dot-size * $dot-scale;