Skip to content

Commit

Permalink
A11y: Update animation/transition styles with reduced motion media qu…
Browse files Browse the repository at this point in the history
…eries
  • Loading branch information
himanshupathak95 committed Dec 26, 2024
1 parent 4ad26e1 commit 2fb1086
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions packages/block-library/src/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@
text-align: center;
padding: 0;
border-radius: 4px;
transition: opacity 0.2s ease;
@media not ( prefers-reduced-motion ) {
transition: opacity 0.2s ease;
}

&:focus-visible {
outline: 3px auto rgb(90 90 90 / 25%);
Expand Down Expand Up @@ -280,16 +282,24 @@
// or faster than the scrim to give a sense of depth.
&.active {
visibility: visible;
animation: both turn-on-visibility 0.25s;
@media not ( prefers-reduced-motion ) {
animation: both turn-on-visibility 0.25s;
}
img {
animation: both turn-on-visibility 0.35s;
@media not ( prefers-reduced-motion ) {
animation: both turn-on-visibility 0.35s;
}
}
}
&.show-closing-animation {
&:not(.active) {
animation: both turn-off-visibility 0.35s;
@media not ( prefers-reduced-motion ) {
animation: both turn-off-visibility 0.35s;
}
img {
animation: both turn-off-visibility 0.25s;
@media not ( prefers-reduced-motion ) {
animation: both turn-off-visibility 0.25s;
}
}
}
}
Expand Down

0 comments on commit 2fb1086

Please sign in to comment.