Add size
prop to icon packages
#10
Labels
carbon icons
Library: icons implemented as Angular, React, Svelte, Vue and vanilla JavaScript components
Milestone
Summary
We currently have ~1,250 icons in our icon packages. Since our system supports 4 sizes, this ends up with ~5,000 modules (1,250 icons * 4 sizes each). Add in a default entry point for each icon and its size, and that becomes ~6,250 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).
Job stories
size
prop that follows the system's size prop convention so I don't end up with failed imports from mis-using the hardcoded sizes in component names.Success measures
<Add32 />
syntaxsize
props are available on the icon componentsSponsoring team
Carbon team
The text was updated successfully, but these errors were encountered: