[wp-trac] [WordPress Trac] #59973: Top blankspace at front-end when disabled admin bar and logged in
WordPress Trac
noreply at wordpress.org
Mon Nov 27 20:11:49 UTC 2023
#59973: Top blankspace at front-end when disabled admin bar and logged in
------------------------------------+-------------------------------
Reporter: Peter Westerlund | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version: 6.4
Severity: normal | Keywords: changes-requested
Focuses: css, php-compatibility |
------------------------------------+-------------------------------
My theme has a sticky header and there is a 32px empty gap between its top
to the frame/document top. The admin bar top offset space. To be clear;
this is when I'm logged in as admin but visiting the site at front-end.
And yes, I have disabled the admin-bar from the profile page in admin. So
the expected behavior should be no admin bar but also no blankspace where
the admin bar would otherwise be.
I know it's possible to get rid of this blankspace via both codes and CSS.
But I wanna address this issue since it shouldn't be like this.
I've been looking around a lot in the core codes. It seems like the /wp-
includes/css/admin-bar$suffix.css is causing the problem since its' loaded
even if the admin bar is disabled. And the first rule in that file is:
{{{
html {
--wp-admin--admin-bar--height: 32px;
scroll-padding-top: var(--wp-admin--admin-bar--height);
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59973>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list