Skip to content

Commit

Permalink
a11y: Add missing reduce-motion mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshupathak95 committed Dec 25, 2024
1 parent c3ca59b commit 42463cf
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions packages/block-editor/src/components/iframe/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions packages/block-editor/src/components/list-view/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,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%);
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/drop-zone/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
opacity: 1;

transition: opacity 0.2s ease-in-out;
@include reduce-motion("transition");
@media (prefers-reduced-motion) {
transition: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 42463cf

Please sign in to comment.