fix: scope admin bar offcanvas padding to mobile viewports (v1.0.12)
All checks were successful
Create Release Package / PHP Lint (push) Successful in 1m8s
Create Release Package / Build Release (push) Successful in 1m44s

Wrap the offcanvas padding-top rule in a max-width: 991.98px media query
so it only applies when the offcanvas is active, not on wide screens
where the navbar renders inline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 21:43:34 +01:00
parent 77778860ab
commit 9904bf508a
3 changed files with 8 additions and 2 deletions

View File

@@ -86,7 +86,7 @@ if ( ! function_exists( 'wp_bootstrap_enqueue_scripts' ) ) :
// Push offcanvas below the WP admin bar when logged in.
if ( is_admin_bar_showing() ) {
wp_add_inline_style( 'wp-bootstrap-style',
'.offcanvas { padding-top: var(--wp-admin--admin-bar--height, 32px); }'
'@media (max-width: 991.98px) { .offcanvas { padding-top: var(--wp-admin--admin-bar--height, 32px); } }'
);
}