[wp-trac] [WordPress Trac] #52623: Proposal: Add CSS variable for admin-bar height to core.

WordPress Trac noreply at wordpress.org
Tue May 25 14:54:53 UTC 2021


#52623: Proposal: Add CSS variable for admin-bar height to core.
-------------------------+-----------------------
 Reporter:  nico23       |       Owner:  ryelle
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  5.8
Component:  Themes       |     Version:  5.7
 Severity:  minor        |  Resolution:
 Keywords:  has-patch    |     Focuses:  ui, css
-------------------------+-----------------------

Comment (by sabernhardt):

 We could remove the `* html body` hack within the callback function while
 adding modern code. (It was added in [17299]/#16222)

 Also, I'm not sure about the benefits of ''replacing'' the height value
 with a variable when link icons have specific width and positioning
 anyway. That would reduce browser support for subscribers on the front end
 and add about 120 bytes to the minified stylesheet.

 It's very late for 5.8 consideration, but I uploaded another option to
 allow using the variable within a theme. A quick test worked with a full-
 height container in Firefox/Windows.
 {{{ height: calc( 100vh - var(--wp-admin--admin-bar--height, 0px) ); }}}

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


More information about the wp-trac mailing list