WAIT: SVG fill doesnt work with Pseudo-classes

Browser: Chrome 112
OS: macOS

SVG fill doesn’t work with a pseudo-class :hover

Try to add Fill for SVG without active pseudo and it will be set for pseudo-elements also.

Real-life use case: Button icon color change on hover.

Hey @Arvoisa,

thanks for your report.

Could you please provide a small screencast (or anything similar) and explain what you’re trying to achieve and what is not working for you? Having a hard time understanding your setup by reading your explanation.

Thanks,

André

I have button, button has SVG icon in it. I have set fill color to #000

I am making :hover for this button. For hover I want to change SVG fill to #FFF. This is currently not possible.

Another example: Streamable

Hey @Arvoisa,

thanks for the update. The video helped understanding your use case. So your icon shall have a different color than the button text? Or do you want to “sync” it?

An easy way for now would be some very basic custom CSS on the button:

root svg {
  fill: orange;
}

root:hover svg {
  fill: red;
}

Best,

André

Yeah, this is a workaround for it.

But shouldn’t this work with just a built-in “pseudo-classes editor”?

Hey @Arvoisa,

it works when using an icon from one of the built-in icon sets and setting the icon color using the icon typography setting. The custom SVG option works differently. I’ll check the possibilities and will get back to you when I have more infos.

Best,

André

Sure, but for speed its much better to load icons as SVG. No need to load whole font family .

Hi, I’m having the same issue when using SVG in Icon list or List elements. Custom CSS works fine in editor mode, but the changes won’t apply on live website. Checked this in Chrome, Firefox and Safari. I set fill color to #fff in SVG options and then I have this CSS code:

root .repeater-item:hover svg{
  fill: #000!important; 
}

Looking for a fix for that. Thank you.