-
Notifications
You must be signed in to change notification settings - Fork 13
Guidelines for SVG Sources
Davide Casali edited this page Jan 11, 2018
·
3 revisions
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
style
reference,fill
included (it defaults to black). - The
svg
tag should contain only thexmlns
andviewBox
attributes. - 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
id
orclass
attribute, 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.
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.