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
:icons
orgraphics
based on their purpose and content- All
icons
should 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
graphics
should 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/icons
folder:assets/svg/check.svg
assets/svg/close-dark.svg
assets/svg/close.svg
assets/svg/date-range.svg
assets/svg/device-size-desktop-icon.svg
assets/svg/device-size-mobile-icon.svg
assets/svg/error.svg
assets/svg/exclamation.svg
assets/svg/help.svg
assets/svg/idea-hub-*.svg
assets/svg/info-icon.svg
assets/svg/keyboard-backspace.svg
assets/svg/lock.svg
assets/svg/magnifying-glass.svg
assets/svg/pencil.svg
assets/svg/suggestion-icon.svg
assets/svg/survey-*.svg
assets/svg/trash.svg
assets/svg/warning-icon.svg
assets/svg/warning.svg
- Review the list of SVGs from the list above to remove hardcoded colors, meaning
fill
should not be a color but set tocurrentColor
.- Add/update styles for icons which previously had hardcoded
fill
so that the icons now rely on thecolor
CSS property.
- Add/update styles for icons which previously had hardcoded
- Remaining icons from
assets/svg
folder should be moved to newassets/svg/graphics
folder. - 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.svg
is 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/icons
Sounds good @aaemnnosttv . Somehow I forgot to add to update the CSS styles 🤦