The many methods for using SVG icons

1 Β· Chen Hui Jing Β· Dec. 23, 2021, 7:46 a.m.
Recently at work, I ran into a situation where we had to revisit how SVG icons were being implemented on our pages. And that gave me the opportunity to dig into the myriad of options we have for doing so. I thought this was worth documenting for future me (and maybe some of you who actually read this blog), because there are a LOT of options. As a pseudo-element via CSS .a-cleverly-named-css-class { /* bunch of pretty styles, oh wow */ &::after { content: url('./some_icon.svg'); display: block; ...