Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
leave default transition, wrap animations with prefers-reduced-motion…
…: no-preference
  • Loading branch information
mediaformat committed Jul 11, 2025
commit b21334357216fac5120d7c6a1d1d675391de94d4
4 changes: 2 additions & 2 deletions plugins/view-transitions/includes/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function plvt_load_view_transitions(): void {
plvt_register_view_transition_animations( $animation_registry );

// Use an inline style to avoid an extra request.
$stylesheet = '@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }';
$stylesheet = '@view-transition { navigation: auto; }';
wp_register_style( 'plvt-view-transitions', false, array(), null ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
wp_add_inline_style( 'plvt-view-transitions', $stylesheet );
wp_enqueue_style( 'plvt-view-transitions' );
Expand All @@ -317,7 +317,7 @@ function plvt_load_view_transitions(): void {
$default_animation_args = isset( $theme_support['default-animation-args'] ) ? (array) $theme_support['default-animation-args'] : array();
$default_animation_stylesheet = $animation_registry->get_animation_stylesheet( $theme_support['default-animation'], $default_animation_args );
$default_animation_stylesheet = plvt_inject_animation_duration( $default_animation_stylesheet, absint( $theme_support['default-animation-duration'] ) );
wp_add_inline_style( 'plvt-view-transitions', $default_animation_stylesheet );
wp_add_inline_style( 'plvt-view-transitions', '@media (prefers-reduced-motion: no-preference) {' . $default_animation_stylesheet . '}' );

/*
* No point in loading the script if no specific view transition names are configured.
Expand Down
Loading