Add an icons for commerce menu items

Created on 13 November 2024, about 1 month ago

Describe your bug or feature request.

If a site builder moves one of the menu items out of the Commerce menu into the main administration toolbar there is no icon for it.

The rework of the commerce administration page (/admin/commerce) added icons for all of these administration pages (Order, Product, Wishlist, etc) and they could be reused as icons for the administrative menu items.

Feature request
Status

Active

Version

3.0

Component

Commerce

Created by

🇺🇸United States rhovland Oregon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @rhovland
  • 🇺🇸United States rhovland Oregon

    Was able to reuse the css variables for the icons and use a css filter to set their color to match the administration toolbar.

    I added styles for the toolbar-tray. I did not add styles for the toolbar-bar since an admin cannot move menu items into that menu.

    I was not able to use mask to set the color because that requires an actual dom element to function properly and modifying the structure of the toolbar isn't really a good idea if it's even possible.

  • 🇺🇸United States rhovland Oregon
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 718s
    #338087
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 337s
    #338091
  • Pipeline finished with Success
    about 1 month ago
    #338092
  • 🇷🇸Serbia majmunbog

    I was not able to use mask to set the color because that requires an actual dom element to function properly and modifying the structure of the toolbar isn't really a good idea if it's even possible.

    @rhovland I prefer we use a mask image. Can you explain how this is not functioning properly?

  • 🇺🇸United States rhovland Oregon

    When I tried it it masked the entire menu item. Maybe I did it wrong? I'm not familiar with using mask to change svg color.

  • 🇷🇸Serbia majmunbog

    This should work:

    .toolbar-tray .toolbar-icon.toolbar-icon-entity-commerce-order-collection::before {
        mask-image: var(--commerce-icon--clipboard-check-fill);
        background-color: #787878;
        mask-repeat: no-repeat;
        mask-position: center;
    }
    

    And then for active just change the background color.

    It would be great if we had a class for all commerce toolbar items.
    The existing icon should also be moved to a variable at some point.

  • Pipeline finished with Success
    16 days ago
    Total: 655s
    #361220
  • 🇷🇸Serbia majmunbog

    The MR has been updated and needs thorough review. I've also updated the standard Commerce icon (drupal cart) to be used as a mask image.

  • Pipeline finished with Failed
    16 days ago
    Total: 585s
    #361237
  • 🇺🇸United States rhovland Oregon

    Thank you for making these updates. I tested the 0eecdb17 version of the MR and it works!

  • Pipeline finished with Skipped
    12 days ago
    #364643
  • First commit to issue fork.
  • Pipeline finished with Skipped
    12 days ago
    #364644
Production build 0.71.5 2024