Problem/Motivation
Right now all the icons are embedded SVGs into the HTML. But in core we don't have a way to tie SVG to menu items, so the only way we'll have to provide icons for now will be the existing solution in the toolbar: with CSS backgrounds.
Proposed resolution
Move all SVG to CSS backgrounds with an strategy close to what the existing Toolbar uses.
Issue fork navigation-3379057
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ckrinaMoving to minor since it won't be necessary for testing purposes.
Comment #3
claireristow commentedWorking on this now
Comment #5
claireristow commentedHey @ckrina, do you mind doing a quick review of my work? I'm wondering if you're ok with the mask-image approach I took for hover color changes or if you'd prefer to have multiple color versions of the icons, or if there's another option entirely!
Comment #6
ckrina@claireristow nice work!
About the mas itself, I personally think it’s a really good modern strategy to avoid what core is currently doing by storing the same icon in several colors. This is assuming all icons will be monochromatic, which I’d say it’s a safe assumption. It is also good because it’ll let us play with accent colors in the future letting us customize the admin UI colors. So unless anybody else has more insights I don’t oversee any problem with this,
The only thing I'd change here is that I would use a BEM pattern to name icons, and use each icon name as a modifier. From
navigation-icon-mediaI’d convert it tonavigation-link--media.You can see an example in action-link.pcss.css.
Comment #8
ckrinaThis is @mherchel feedback in Slack :)
Comment #9
claireristow commentedThanks for the feedback @ckrina and @mherchel, I'll work on those changes!
Comment #11
claireristow commentedMerged updates to BEM-style classes and setup CSS variables for icons!