This repository has been archived by the owner on May 6, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds the SVG files for the icons used throughout Quartz. It does not yet implement anything that allows the icons to be used. See options below...
This PR can be used for discussion. I outline 3 approaches I think would be appropriate, but these need consideration before any one of them is implemented.
Current approach
All of the icons get run through a process that inlines them (in base64) into a css file. They also get manually assigned a color, so
.icon-product--teal
is almost a complete duplicate of.icon-product--gray
, with a slightly different base64 representation to change thefill
property.Proposed approaches
<img src='/icons/product.svg' className='icon icon--teal'/>
in jsx. This is great for caching and requires almost no engineering effort. It's supported back to IE9. Instead of creating duplicate icons, we can one-time defineicon--teal
and similar classnames to set the appropriate svgfill
color..icon--product { background: url('/icons/product.svg') }
in css. Same benefits as option 1. Also supported all the way back to IE9..icon--product { background: url('data:image/svg+xml; ...') }
in css. Using base64 to inline the icons in css is worse for caching but better in that it saves an http request to fetch the svg. We can still use the class names that set thefill
so that we don't have to duplicate each icon's path data for every color. Aside from the cache/request tradeoff, the only downside is that this will require a build step to handle converting to base64.Options 1 and 2 can optionally reference the svgs from a cdn rather than paths on our server.
Other approaches not considered