jonathantneal / svg4everybody

Use external SVG spritemaps today
https://jonneal.dev/svg4everybody/
Other
3.29k stars 353 forks source link

Add option to always replace contents ignoring browser support #191

Closed Dan503 closed 5 years ago

Dan503 commented 5 years ago

I read this article: https://css-tricks.com/inline-svg-cached/

It suggests using JS to replace the SVG <use> element with the content of the SVG. This makes it easier to style the SVG with CSS. This also happens to be exactly what svg4everybody does but as a polyfill.

Can an option be added to force the functionality in all browsers rather than just the ones that don't support external sources? It could be { force: true }.

trisys3 commented 5 years ago

There already is an option for this, called polyfill. There's also an option called validate that determines which SVGs to replace. Of course, neither option is very well documented, so I understand your confusion.

Dan503 commented 5 years ago

Ahhh I thought polyfill might do it but I wasn't sure. The documentation for that option is very confusing 😖