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

Editor: Standardize reduced motion handling using media queries #68424

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions packages/editor/src/components/document-bar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@

.components-button {
border-radius: $grid-unit-05;
transition: all 0.1s ease-out;
@include reduce-motion("transition");

@media not (prefers-reduced-motion) {
transition: all 0.1s ease-out;
}

&:hover {
background: $gray-200;
Expand Down
5 changes: 3 additions & 2 deletions packages/editor/src/components/document-tools/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
display: inline-flex;

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
6 changes: 4 additions & 2 deletions packages/editor/src/components/post-featured-image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@

.editor-post-featured-image__actions {
&:not(.editor-post-featured-image__actions-missing-image) {
@include reduce-motion("transition");
bottom: 0;
opacity: 0; // Use opacity instead of visibility so that the buttons remain in the tab order.
padding: $grid-unit-10;
position: absolute;
transition: opacity 50ms ease-out;

@media not (prefers-reduced-motion) {
transition: opacity 50ms ease-out;
}

.editor-post-featured-image__action {
backdrop-filter: blur(16px) saturate(180%);
Expand Down
6 changes: 4 additions & 2 deletions packages/editor/src/components/post-publish-panel/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,10 @@
width: $sidebar-width + $border-width;
border-left: $border-width solid $gray-300;
transform: translateX(+100%);
animation: editor-post-publish-panel__slide-in-animation 0.1s forwards;
@include reduce-motion("animation");

@media not (prefers-reduced-motion) {
animation: editor-post-publish-panel__slide-in-animation 0.1s forwards;
}

body.is-fullscreen-mode & {
top: 0;
Expand Down
6 changes: 4 additions & 2 deletions packages/editor/src/components/post-text-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ textarea.editor-post-text-editor {
font-family: $editor-html-font;
line-height: 2.4;
min-height: 200px;
transition: border 0.1s ease-out, box-shadow 0.1s linear;
@include reduce-motion("transition");

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

// Same padding as title.
padding: $grid-unit-20;
Expand Down
Loading