Skip to content

Commit f9a14d9

Browse files
authored
Merge pull request #2068 from mediaformat/fix/prefers-reduced-motion
View-Transitions: Respect prefers-reduced-motion settings
2 parents 714dd71 + b213343 commit f9a14d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/view-transitions/includes/theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ function plvt_load_view_transitions(): void {
317317
$default_animation_args = isset( $theme_support['default-animation-args'] ) ? (array) $theme_support['default-animation-args'] : array();
318318
$default_animation_stylesheet = $animation_registry->get_animation_stylesheet( $theme_support['default-animation'], $default_animation_args );
319319
$default_animation_stylesheet = plvt_inject_animation_duration( $default_animation_stylesheet, absint( $theme_support['default-animation-duration'] ) );
320-
wp_add_inline_style( 'plvt-view-transitions', $default_animation_stylesheet );
320+
wp_add_inline_style( 'plvt-view-transitions', '@media (prefers-reduced-motion: no-preference) {' . $default_animation_stylesheet . '}' );
321321

322322
/*
323323
* No point in loading the script if no specific view transition names are configured.

0 commit comments

Comments
 (0)