Organize SVG assets
See original GitHub issueFeature Description
Currently we have a flat directory of svg files in assets/svg which includes mostly icons, but also has some vector graphics. It would be good to organize these accordingly based on their type since these are quite different in their use.
The main difference with icons is that these are essentially a single color which should be inherited (i.e. fill=currentColor) whereas graphics may be many colors which don’t change. Graphics are usually much larger in terms of their markup as well having many complex shapes, strokes, and fills.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- SVG assets should be organized into one of two new subdirectories within
assets/svg:iconsorgraphicsbased on their purpose and content- All
iconsshould be simple single-color svg elements which inherit their stroke/fill color from the current color via CSS (i.e.currentColor)- Any icons with hardcoded colors should be updated accordingly and the application of its color should be moved to a relevant component/stylesheet
- All
graphicsshould be svg “images” that should always have specific color(s) that should always be used (e.g. Site Kit side kicks)
- All
Implementation Brief
- Move the following SVGs to new
assets/svg/iconsfolder:assets/svg/check.svgassets/svg/close-dark.svgassets/svg/close.svgassets/svg/date-range.svgassets/svg/device-size-desktop-icon.svgassets/svg/device-size-mobile-icon.svgassets/svg/error.svgassets/svg/exclamation.svgassets/svg/help.svgassets/svg/idea-hub-*.svgassets/svg/info-icon.svgassets/svg/keyboard-backspace.svgassets/svg/lock.svgassets/svg/magnifying-glass.svgassets/svg/pencil.svgassets/svg/suggestion-icon.svgassets/svg/survey-*.svgassets/svg/trash.svgassets/svg/warning-icon.svgassets/svg/warning.svg
- Review the list of SVGs from the list above to remove hardcoded colors, meaning
fillshould not be a color but set tocurrentColor.- Add/update styles for icons which previously had hardcoded
fillso that the icons now rely on thecolorCSS property.
- Add/update styles for icons which previously had hardcoded
- Remaining icons from
assets/svgfolder should be moved to newassets/svg/graphicsfolder. - Update codebase to reference new SVG paths where they are used.
Test Coverage
- No new tests should be added.
Visual Regression Changes
- None
QA Brief
- Ensure icons are in their correct locations. (
idea-hub-notification.svgis in graphics ) - Ensure VRT runs correctly.
- Check icons and graphics throughout the interface for visual differences (including different feature flags)
Changelog entry
- N/A
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
How do you organize your SVG's - Community Café - Inkscape
I mostly illustrate and recombine SVG for screen use. And it's very useful to keep track of SVG assets and search them by...
Read more >A more efficient and organized workflow for SVGs - Thoughtbot
SVGO is a Nodejs-based tool for optimizing SVG files. A simple command removes or converts the insignificant information in SVGs, reducing the ...
Read more >How to Organize and Sync SVG Files with Iconset
SVG is an awesome way to bring vector images into a design and development workflow. But collecting and organizing SVG files on your ......
Read more >Preparing SVG Illustrations for Export | by Kelly Dern - Medium
The SVG file is an unwieldy mess, and far too much effort to organize through SVG alone. It's difficult to parse out where...
Read more >Elegantly Manage SVG Icons in Angular Applications
The svg-icon library enables using the <svg-icon> tag to directly display SVG icons in the DOM. This approach offers an advantage over using...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

QA update ✅
Verified
assets/svg/iconsSounds good @aaemnnosttv . Somehow I forgot to add to update the CSS styles 🤦