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

Icon: Reconsider color API for standard SVG icons #40102

Open
mirka opened this issue Apr 6, 2022 · 1 comment · May be fixed by #57459
Open

Icon: Reconsider color API for standard SVG icons #40102

mirka opened this issue Apr 6, 2022 · 1 comment · May be fixed by #57459
Assignees
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@mirka
Copy link
Member

mirka commented Apr 6, 2022

What problem does this address?

The most common use of the Icon component involves the standard SVG WordPress icons or similar single-color SVG icons. Currently, there is no official API to control the color of the SVG fill.

This often leads to subtle differences in blacks (e.g. if the SVG fill is by default #000000 and the text color is a slightly lighter black). Or, it requires ad hoc CSS to override the fill color.

What is your proposed solution?

Add a fillColor prop that defaults to currentColor so most cases will just match the surrounding text color automatically.

The tricky part about this is backwards compatibility, and also the fact that Icon technically accepts things that are not SVGs. We'll need to decide what the best strategy is, whether that be deprecation or adding a new component that's specific to single-color SVG icons.

@mirka mirka added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Apr 6, 2022
@github-actions
Copy link

github-actions bot commented Oct 4, 2022

Hi,
This issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the Needs Testing Needs further testing to be confirmed. label Oct 4, 2022
@mirka mirka removed the Needs Testing Needs further testing to be confirmed. label Oct 13, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant