Skip to content

Commit 45b9b7e

Browse files
Make use of plvt_inject_animation_duration in fade effect
1 parent ac22ba5 commit 45b9b7e

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

plugins/view-transitions/includes/theme.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,7 @@ function plvt_load_view_transitions(): void {
316316
*/
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 );
319-
if ( '' !== $default_animation_stylesheet ) {
320-
$default_animation_stylesheet = plvt_inject_animation_duration( $default_animation_stylesheet, absint( $theme_support['default-animation-duration'] ) );
321-
} else {
322-
$seconds = absint( $theme_support['default-animation-duration'] ) / 1000;
323-
$default_animation_stylesheet = sprintf(
324-
/* translators: %s is animation duration in seconds. */
325-
'::view-transition-group(*) { animation-duration: %ss; }',
326-
$seconds
327-
);
328-
}
319+
$default_animation_stylesheet = plvt_inject_animation_duration( $default_animation_stylesheet, absint( $theme_support['default-animation-duration'] ) );
329320
wp_add_inline_style( 'plvt-view-transitions', $default_animation_stylesheet );
330321

331322
/*

0 commit comments

Comments
 (0)