Guidelines for SVG Sources - Automattic/gridicons GitHub Wiki
Here's the current draft for a guideline to write the SVG used in the icon set sources. It's still in progress, and feel free to review.
- Remove any internal
stylereference,fillincluded (it defaults to black). - The
svgtag should contain only thexmlnsandviewBoxattributes. - Keep or add the
<?xml version="1.0" encoding="UTF-8"?>declaration. - Remove any "generator" or superfluous comment. Keep comments that clarify the SVG content.
- Remove any superfluous
idorclassattribute, keep the ones that are semantically meaningful. - Remove any superfluous empty tag and fix any weird nesting.
- Make sure the cleaned up SVG still renders as the original.
- Note: don't add the transparent rectangle as it will make the icon full black (see #274). It's added by the script.
Tools
If you use SVGOMG, which is really good, make sure you configure it to do "Prettify" (the file should stay readable) and to re-introduce the meaningful bits from the list above.