How to overload favicon when using theme inheritance?

I’m struggling with how to overload a favicon when customizing a theme through theme inheritance. E.g. I’m using the learn2 theme, and the base.html.twig refers to {{ url(‘theme://images/favicon.png’) }} .

I have overloaded the theme with a my-learn2 theme and set this as the active theme. So I would expect that “url(‘theme://images/favicon.png’)” would refer to the my-learn2 theme directory, but it doesn’t: it refers to the base theme folder.

What is the correct way to get the “my-learn2” favicon to replace the favicon of the base theme?

Interesting. I think it should work in that way, which is more logical.

Try copying the base.html.twig into your theme. Does it work then?

Oh darn… this is embarrassing: I had a favicon.ico in my own theme folder… not a PNG. My bad, sorry! It works as expected when there is a PNG in there.

Thanks so much for the quick response, @flaviocopes!