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

add a unique class for each <svg> #65

Closed
brillout opened this issue Nov 8, 2016 · 5 comments
Closed

add a unique class for each <svg> #65

brillout opened this issue Nov 8, 2016 · 5 comments

Comments

@brillout
Copy link

brillout commented Nov 8, 2016

E.g. <svg class="ri ri-fa-star" .../> for the fa-star icon.
So that adjustments can easily be implemented.

@bentatum
Copy link
Collaborator

We can totally discuss doing this, but for now you should be able to accomplish whatever you need to do using composition.

<div class="ri ri-fa-star">
  <svg />
</div>

@bentatum
Copy link
Collaborator

@gorangajic thoughts on this?

@brillout
Copy link
Author

It's actually what I'm doing right now but wrapping each icon individually is a bit cumbersome.

It seems to me that there are more important tickets though, e.g. #66

Thanks @bentatum for your work on this, I like this library a lot

@bentatum
Copy link
Collaborator

I see what you mean. We'll keep it on the list.

For now, you could also create a component that does the wrapping once for you.

// CustomIcon.js
import Icon from 'react-icons/lib/io/arrow'
export default ({ className, ...props }) =>
  <div className={className}>
    <Icon {...props} />
  </div>

and then use it like this:

// App.js
import Icon from './CustomIcon'
export default () => <Icon className='ri ri-fa-star' />

@bentatum
Copy link
Collaborator

bentatum commented Dec 29, 2016

I'm going to close this for now. Feel free to submit a PR to propose any desired functionality you may have and we'll consider it!

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

No branches or pull requests

2 participants