Skip to content

Commit

Permalink
update: store overlay style to variable for better readibility and pe…
Browse files Browse the repository at this point in the history
…rformance
  • Loading branch information
up1512001 committed Jun 17, 2024
1 parent 59286b1 commit e34a16b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ private static function get_responsive_container_markup( $attributes, $inner_blo
';
}

$overlay_inline_styles = esc_attr( safecss_filter_attr( $colors['overlay_inline_styles'] ) );

Check failure on line 522 in packages/block-library/src/navigation/index.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Spaces must be used for mid-line alignment; tabs are not allowed

Check failure on line 522 in packages/block-library/src/navigation/index.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Whitespace found at end of line

return sprintf(
'<button aria-haspopup="dialog" %3$s class="%6$s" %10$s>%8$s</button>
<div class="%5$s" %7$s id="%1$s" %11$s>
Expand All @@ -537,7 +539,7 @@ private static function get_responsive_container_markup( $attributes, $inner_blo
$toggle_aria_label_close,
esc_attr( implode( ' ', $responsive_container_classes ) ),
esc_attr( implode( ' ', $open_button_classes ) ),
( ! empty( esc_attr( safecss_filter_attr( $colors['overlay_inline_styles'] ) ) ) ) ? ( 'style="' . esc_attr( safecss_filter_attr( $colors['overlay_inline_styles'] ) ) . '"' ) : '',
( ! empty( $overlay_inline_styles ) ) ? "style=$overlay_inline_styles" : '',
$toggle_button_content,
$toggle_close_button_content,
$open_button_directives,
Expand Down

0 comments on commit e34a16b

Please sign in to comment.