Skip to content

Commit 2e85ee9

Browse files
committed
fix: disable view transition animations when reduced motion is preferred
Adds a CSS rule scoped to the lightbox portal presence that sets animation-duration: 0s on ::view-transition-old/*-new pseudo-elements under prefers-reduced-motion: reduce, without affecting other page transitions.
1 parent ca34517 commit 2e85ee9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/styles.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ $toolbar-margin: 8px;
1313

1414
html:has(body > .yarll__portal) {
1515
overscroll-behavior: none;
16+
17+
@media (prefers-reduced-motion: reduce) {
18+
&::view-transition-old(*),
19+
&::view-transition-new(*) {
20+
animation-duration: 0s;
21+
}
22+
}
1623
}
1724

1825
body:has(> .yarll__portal:not(.yarll__no_scroll_lock)) {

0 commit comments

Comments
 (0)