Closed antoineKorbit closed 2 years ago
What's the use case for this? IMO, this feels slightly cumbersome syntax, and it doesn't solve the issue that it's still reliant on svg-loader. Better way could be to have CSS background by default, which can be reset by svg-loader is SVG loading is successful.
I wasn't able to detect when the svg-loader failed to load the SVG from the URL. Interesting solution using CSS, but how loading successfully the SVG, can reset the CSS background ?
I added the possibility to have a fallback icon using the attribute
data-fallback
. The expected value is default SVG source code, that the library will use in case something went wrong during the download of thedata-src
attribute. I added more information and instructions how to use it in the README.md.