Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,18 @@ function inline_scripts() {
'; path=<?php echo esc_js( $current_site->path ); ?>';
} );
}

var closeButton = document.getElementById( 'secondary-close' );
if ( closeButton ) {
closeButton.addEventListener( 'click', function() {
document.body.classList.remove( 'responsive-show' );
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

var toggle = document.getElementById( 'secondary-toggle' );
if ( toggle ) {
toggle.focus();
}
} );
}
</script>
<?php
}
Expand Down Expand Up @@ -398,7 +410,7 @@ function welcome_box() {
add_filter( 'o2_post_fragment', '__return_empty_array' );
?>
<div class="make-welcome">
<a href="#" id="secondary-toggle" onclick="return false;"><strong><?php esc_html_e( 'Menu', 'wporg' ); ?></strong></a>
<button type="button" id="secondary-toggle" aria-label="<?php esc_attr_e( 'Open menu', 'wporg' ); ?>"></button>
<div class="entry-meta">
<?php edit_post_link( __( 'Edit', 'wporg' ), '', '', $welcome->ID, 'post-edit-link make-welcome-edit-post-link' ); ?>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
return;
?>
<div id="secondary" class="widget-area" role="complementary">
<a href="#" id="secondary-toggle"><button aria-label="Close menu" class="wp-block-navigation__responsive-container-close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg></button></a>
<button type="button" id="secondary-close" aria-label="<?php esc_attr_e( 'Close menu', 'wporg' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg></button>
<div id="secondary-content">
<?php do_action( 'before_sidebar' ); ?>
<?php dynamic_sidebar( wporg_get_current_handbook() ); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div id="primary-modal"></div>
<div id="secondary" class="widget-area" role="complementary">
<h2 class="screen-reader-text"><?php esc_html_e( 'Site resources', 'wporg' ); ?></h2>
<a href="#" id="secondary-toggle"><button aria-label="Close menu" class="wp-block-navigation__responsive-container-close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg></button></a>
<button type="button" id="secondary-close" aria-label="<?php esc_attr_e( 'Close menu', 'wporg' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg></button>
<div id="secondary-content">
<?php do_action( 'before_sidebar' ); ?>
<?php dynamic_sidebar( 'sidebar-1' ); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,10 @@ input[type="submit"]:hover {
max-width: 100%;
}

#secondary-close {
display: none;
}

@media (max-width: 876px) {
.content-area {
width: 100%;
Expand Down Expand Up @@ -970,30 +974,44 @@ input[type="submit"]:hover {
}

#secondary-toggle {
display: flex;
align-items: center;
justify-content: center;
float: inline-start;
margin-right: unset;
margin-top: -12px;
text-align: end;
}

#main #secondary-toggle {
margin-inline-start: 4px;
margin-inline-end: var(--wp--style--block-gap);
margin-top: 20px;
margin-top: -24px;
margin-inline: 8px 0;
padding: 0;
border: 0;
background: none;
color: var(--wp--preset--color--charcoal-4);
cursor: pointer;
}

#secondary-toggle:before {
top: 0;
color: var(--wp--preset--color--charcoal-4);
font-size: 24px;
}

body.responsive-show #secondary-toggle:before {
content: '';
color: #0073aa;
#secondary-close {
display: flex;
align-items: center;
justify-content: center;
width: 48px;
height: 48px;
margin-block: 8px 0;
margin-inline: auto 8px;
padding: 0;
border: 0;
background: none;
cursor: pointer;
}

#secondary-toggle:focus-visible,
#secondary-close:focus-visible {
outline: thin dotted;
}

#secondary-toggle svg {
#secondary-close svg {
background-color: #fff;
fill: var(--wp--preset--color--charcoal-4);
height: 36px;
Expand Down
Loading