While studying, I have to keep some notes to better explain myself what is going on through my readings and annotate some of my conclusions about the code.
- For a more accessible SVG, you should use
<title></title>
to describe the content for blind people. - Use
<desc></desc>
to describe the content, it gets read by screen readers and helps to understand the SVG code.
- SVG as a
background-image
icon isn't a good idea. Why?background-image
withsvg
kills the use of a few properties suchfill
- You are not able to customize the color even using
background-color
orcolor
- Use a
def
file instead of loading icon by icon - Generate SVG sprites
- obs: The concept of sprites in SVG are a bit different than the usual (with multiple images in one file and using
background-position
to coordinate them). With that in mind:<defs>
are like classes: they are used only if you reference them.
- obs: The concept of sprites in SVG are a bit different than the usual (with multiple images in one file and using