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.
Intro
This PR introduces a set of changes that allows a consumer to generate a customized React SVG component. This library already changes certain things and improves on others (using svgr). This leads to a problem that we have..
Problem
As of now, we have no way to customize the component -- meaning recoloring. The current solution is to generate another SVG component with the desired color. Not ideal.
How it works
This PR adds another code sweep in order to:
hex
color codes in the source SVG files...rest
into main svg container elementfill
s orstroke
with the color array received from props or from the pre-defined default colors extracted from the SVG source file.Usage
Scenario 1 - Simple string color
Scenario 2 - Multi color icon - The color order follows the order color appearance in the component/svg
Scenario 3 - No need to pass a color down. It will apply whatever was part of the svg file.
Show me the final product
To do
Last thing
How do you update the snapshot? is it a manual thing?