Issue Task New Orphaned

#109333Use alternative markup for icons in ModifyButtonBarEvent

Tobias Jungmann 03/24/26, 08:24 updated 03/24/26, 08:24

Description

I’m using a ModifyButtonBarEvent event listener to add a button. This button has an svg icon (not sprite). It does not seem possible to set an alternative markup in this context.

I need the inline context because the icon uses currentColor to match the dark mode option.

My workaround is to set the markup to the alternative markup:

$button = $this->componentFactory->createGenericButton();
$icon = $this->iconFactory->getIcon('page-feedback-thumbs-up-regular');
$icon->setMarkup($icon->getAlternativeMarkup(SvgIconProvider::MARKUP_IDENTIFIER_INLINE));
$button->setIcon($icon)

Maybe svg icons should be rendered generally inline in that context?

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[TASK] Use alternative markup for icons in ModifyButtonBarEvent Resolves: #109333 Releases: main