First off, I use Stylish a lot, so I have no control over the markup. I have encountered a situation where an element has a zero-height but still has content, so an :empty
pseudo class selector can not be used.
Given the following markup, I would like to change the position of the navigation bar based on the (non-zero) height of the notification:
<div id="notification"><table></table></div>
<div></div>
<nav id="topbar">...</nav>
The following CSS would be useful:
#notification:not(:zero-height) ~ #topbar {
top: 34px;
}
Using the actual height of the notification would be nice, but I’ll save that proposal for later
Or, maybe a more useful request would be to add a :has-height
pseudo class? Because I think one would almost always use :not(:zero-height)
.