Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/icon #22

Open
wants to merge 6 commits into
base: staging
Choose a base branch
from
Open

Feature/icon #22

wants to merge 6 commits into from

Conversation

declanelcocks
Copy link

  • Adds an <Icon /> component to easily add in SVG icons to the HTML
  • Requires raw-loader from webpack to process the SVG files
  • Adds search.svg icon

For now, only added in the search SVG. I wanted to scaffold out the structure of the component first with an example to make sure you were happy with the folder/component structure I was using since I'm just joining the project.

@declanelcocks declanelcocks self-assigned this May 4, 2017
@declanelcocks declanelcocks requested a review from v2arunv May 4, 2017 07:38
@declanelcocks
Copy link
Author

declanelcocks commented May 4, 2017

@Maestro501 I looked into why I was doing this as I couldn't remember exactly why I chose to do it before in another project. The raw-loader and dangerouslySetInnerHTML is used so that I can inject the SVG markup into the HTML. I did this because it makes it possible to style the SVG using CSS (e.g. fill, stroke etc.) which is a lot more convenient/consistent, and lets us put all the styling in once place. CSS styling for an SVG would not be possible with an <img> tag and url-loader parsing the SVG url. This is why raw-loader is used because it's directly parsing the raw SVG file, and not just parsing a URL like it would with CSS or with an <img> tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant