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

[icons-react] Use a size prop, don’t export 4 bespoke sprites/components per icon #5170

Closed
vpicone opened this issue Jan 24, 2020 · 1 comment
Labels
proposal: open This request has gone through triaging. We're determining whether we take this on or not. role: dev 🤖 type: enhancement 💡

Comments

@vpicone
Copy link
Contributor

vpicone commented Jan 24, 2020

Looking to add copy + paste react code to the website icon library. We want avoid giving a hard-coded size (<Add32 />).

A generic <Add size='sm/md/lg/xl' /> component would make for a much better candidate for copy+paste. The current API makes it hard to know what sizes are available, users are more likely to have a failed import than a prop-type failure.

I think our initial implementation of this package was beholden to the idea that we’d come up with hand tuned, bespoke icon assets at each size. This isn’t scaleable and results in idiosyncrasies when components are used together. (Example + and -).

By simply reducing the width of the 32 px svg and scaling down, we'd be able to accomodate all 4 sizes with a single component.

@joshblack
Copy link
Contributor

Tracking in: #8139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal: open This request has gone through triaging. We're determining whether we take this on or not. role: dev 🤖 type: enhancement 💡
Projects
None yet
Development

No branches or pull requests

3 participants