Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
At the moment the CSS applied to the menu items are very general. All custom menu styling is affected by e.g.:
.menu-item:hover {
background: #fff;
}
.menu-item:focus {
background: #abeae4;
}
.menu-item--expanded .menu {
background: #fff;
width: auto;
height: auto;
}
.menu-item--expanded {
background-color: #f5f5f2;
}
To avoid making people override those styles, I would recommend to either scope those styles to be descendants of e.g. ".toolbar-bar" or MUCH BETTER to adhere to Drupal 8 CSS conventions and add modular classes like ".toolbar__menu-item".
Comment | File | Size | Author |
---|---|---|---|
#8 | 2658896-8.patch | 5.16 KB | echoz |
#6 | 2658896-6.patch | 4.27 KB | echoz |
Comments
Comment #2
eme CreditAttribution: eme commentedAlready fixed in dev version.
Comment #3
tancDev version still exhibits this behaviour. Downloaded from project page, dated 2016-Feb-2. See also http://cgit.drupalcode.org/admin_toolbar/tree/css/admin.toolbar.css
Comment #4
eme CreditAttribution: eme commentedWell indeed, there is a regression on this. Putting this on "Major". We've two major bug to fix for a quick new release.
Comment #5
matio89 CreditAttribution: matio89 commentedHi,
We scope menu (item) CSS to admin_toolbar to avoid conflict.
View the 8.x-1.14 version:
https://www.drupal.org/node/2664674
Comment #6
echoz CreditAttribution: echoz commentedPatch is against 8.x-1.14 because the dev version does not have these latest changes(!).
Fixed the scope being too specific which lost some of the matching style on the vertical menu (back the way it was in 8.x-1.12).
Corrected to following CSS formatting guidelines.
Comment #7
mansspams CreditAttribution: mansspams at Wunder commentedPlease do patches against dev version. We need progress :)
Comment #8
echoz CreditAttribution: echoz commentedPatch against dev version.
Added spacing corrections on admin_toolbar_tools css as well.
Comment #10
eme CreditAttribution: eme commentedI have refactored with PHPStorm the file, cleaned some things, added the .toolbar class and fix also some other minor issues (chevron).
Comment #11
echoz CreditAttribution: echoz commented@eme, I believe you need to set your editor to comply with CSS formatting guidelines of indentation, "Use 2 spaces for each level of indentation, the same standard as Drupal’s PHP and JavaScript code." This is what I pointed out, and patched in #6 and #8.
Also I still believe that using only the horizontal class in the first 4 declarations of admin.toolbar.css leaves out some matching styles on the vertical toolbar, than using just .toolbar does, as it was in 8.x-1.12.
Comment #14
eme CreditAttribution: eme commentedLet's focus on #2759519: comply with CSS formatting guidelines issue that is more advanced now. Thx.