[wp-trac] [WordPress Trac] #61898: Use --wp-admin--admin-bar--height variable in css

WordPress Trac noreply at wordpress.org
Wed Feb 26 17:58:10 UTC 2025


#61898: Use --wp-admin--admin-bar--height variable in css
-------------------------+-----------------------------
 Reporter:  tdrayson     |       Owner:  SergeyBiryukov
     Type:  enhancement  |      Status:  reviewing
 Priority:  normal       |   Milestone:  6.8
Component:  Toolbar      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  css
-------------------------+-----------------------------

Comment (by emmanuelkuebu):

 Replying to [comment:12 dilip2615]:
 > according to my thoughts we can use and implement using bellow code
 >
 > html.wp-toolbar
 > {
 >  padding-top: var(--wp-admin--admin-bar--height, 32px);
 >  box-sizing: border-box;
 >  -ms-overflow-style: scrollbar;
 > }
 >

 I believe the --wp-admin--admin-bar--height variable is set exclusively
 when a logged-in user with admin bar access is viewing the page.
 Therefore, implementing a fallback value would create an unnecessary gap
 above the header for users who are logged out or lack admin bar
 privileges.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61898#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list