The admin theme tries to generate an icon class for each menu item.
However in some cases this can cause invalid classnames, that are difficult/impossible to style.
For example one generated classname I encountered was 'toolbar-icon-views-view:views-pages-page'.
This can be easily prevented by passing the classname through the cleanCssIdentifier function. It might even make the previous line of code obsolete. I have added a patch that fixes this.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | admin_toolbar_invalid_class_names-2931503-1.patch | 861 bytes | j3ll3nl |
Comments
Comment #2
Buvaneshwari.V commented@K3vin_nl,
The above patch is working fine.
Comment #3
Buvaneshwari.V commentedComment #4
Buvaneshwari.V commentedComment #6
j3ll3nlHereby the git diff version for this patch for use in drupal-composer project composer.json.
Comment #7
joelpittetThis looks good, thanks for the patch.
Comment #10
eme commentedThanks for the report and the patch !
Comment #12
Christopher Riley commentedI am still getting an invalid class name losing the total control dashboard icon.
Class Generated System Toolbar (this one works)
toolbar-icon toolbar-icon-total-control-menu-link:system-total-control-dashboard
Class Generated With Admin Toolbar (this one doesn't work)
toolbar-icon toolbar-icon-total-control-menu-linksystem-total-control-dashboard
Notice the colon missing between link and system?
Is this something that Total Control Dashboard needs to address or something Admin Toolbar needs to address?
Thanks in advance.
Comment #13
joelpittetcolons have special meaning in CSS and shouldn't be used as identifiers. So probably something that total control needs to address