Open jamesmfriedman opened 5 years ago
We've come to the consensus that mdc-icon should be a separate component that other components would use (ie. select, text-field, icon-button, etc.). This is a feature request and needs to be vetted before implementing.
Great. I would encourage you to check out my reference implantation since I can confirm it works the way you would expect in all places in the api.
There are many places where icons are used in mdc-web. The 'idea' of an icon is all over the place, but the implementation is scattered. This makes it hard for consumers to do things at runtime that can globally impact icons.
Here are some real world examples...
These are all icons, but only in concept. There is no global selector I could make to target all of them. Here is my proposed, extremely simple fix.
This would allow you to inherit a lot of behavior across all icons, and also give consumers some more control over them.
Let me be clear, I am NOT advocating for it to have a foundation, or any javascript behavior at all. Just shared styles with a deterministic class name.
For reference, this is RMWC's custom implemenation of the above proposed that adds in icon sizing from the spec as well. https://github.com/jamesmfriedman/rmwc/blob/master/src/icon/icon.css
Thanks!
UPDATE:
The reason this came up, and an actual issue to fix with it. Icons can be either svg or font icons and should respect color either way (it doesn't currently in all cases). Proposed fix.