Problem/Motivation

An example: you want to have a toolbar tab that is initially hidden, and JS can make it available if some condition is fulfilled.

Examples:

Just setting class="element-hidden" on either the tab wrapper (via #wrapper_attributes) or on the tab itself (via #attributes) is insufficient, because:

  1. In the former case:
    .js .toolbar .bar .tab,
    .js .toolbar .menu li {
      display: block;
    }
    
  2. In the latter case:
    .js .toolbar a {
      display: block;
    }
    

Both of those are more specific than .element-hidden { display: none; }, hence it doesn't work. This implies we must start adding CSS like this to make it work:

.js .toolbar .bar .contextual-toolbar-tab.tab.element-hidden {
  display: none;
}

More generally speaking, why is it necessary to have such specific selectors: .js .toolbar .bar .tab?

Proposed resolution

Figure out whether this is necessary, and very likely it is, but in that case, it should be clearly documented why this is the case; preferably at the top of toolbar.base.css.

Remaining tasks

TBD>

User interface changes

None.

API changes

None.

Comments

lewisnyman’s picture

Status: Active » Closed (duplicate)
Issue tags: +frontend, +CSS

Closing in favour of #1663198: Clean up toolbar css, where we can apply the entirety of our CSS standards in one go.