How to use SVG context-fill in sidebar

In Firefox’s tab strip, favicons in SVG with context-fill attribute value is filled correctly with theme’s color (white in dark mode). How to do this in a sidebar (or any other extension pages)?

fill: currentColor with SVG in background-image does not seem to work. Trying <img>.

Did not work. Any way to do this in an extension?