-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 size
prop to icon packages
#8139
Comments
Sounds like a great plan. Will the |
Hey @metonym! 👋 Yes, definitely. We might end up doing a dedicated |
Awesome – thank you Josh |
Will there ever be a |
Hi @veganD! 👋 At the moment there isn't a plan to add support but it's definitely something that we want to do. Unfortunately, it came down to time and what the team is able to maintain with our focus on React and the styles. We're super open to contributions for this or working with folks who would like to add in support for it! |
We currently have ~1,250 icons in our icon packages. Since our system supports 4 sizes, this ends up with ~5,000 modules (1250 icons * 4 sizes each). Add in a default entry point for each icon and its size, and that becomes ~6250 files that get shipped in a package.
Historically, we've had to invest some time to fix infrastructure issues that have come from trying to satisfy packages that can grow to this size. In addition, it is easy for these packages to deopt and cause consumers to ship megabytes more code than they intend to when using this module.
Moving forward, we are moving from our "component per icon/size" strategy to a "icon with size prop" approach. While this could increase the size of individual icons that support multiple sizes, this would decrease the overall file size of each package and would allow better code re-use for icons that are downsized from 32x32 (which are the majority)
Packages impacted
@carbon/icons
@carbon/icons-react
@carbon/icons-angular
@carbon/icons-vue
Checklist
react-next
to the react builder and include it inicons-react
size
propvanilla-next
to the builders and include it inicons
vue-next
to the builders and include it inicons-vue
carbon-components-react
icon usage to use this new size approachThe text was updated successfully, but these errors were encountered: