Problem/Motivation
As part of #3483209: Navigation leverage icon core API, Icon API was introduced in Navigation to manage the icons for the Navigation elements provided by default.
This implementation was a first step to give more flexible support for icons in the future.
The aim of this issue is to enhance the Icon API integration, replacing hardcoded values with defaults that could be overridden by the menu items by themselves.
The icon properties that were hardcoded (icon_pack & settings) will be configurable, allowing menu items to declare their own icon from the yml file. A couple of new props will be added to the navigation:toolbar-button
SDC component.
Menu Items would be able to define their own icons in this way:
mymodule.navigation_item:
title: "Test Custom Icon"
weight: 1
menu_name: admin
parent: system.admin
route_name: "<front>"
options:
icon:
pack_id: navigation
icon_id: burger
settings:
class: 'toolbar-button__icon'
size: 25
In the near future, support for menu items created through the UI will be provided via UI Icons module.
Proposed resolution
Replace hardcoded values with configurable values