Default icon color inconsistencies
Prerequisites
- [X] I have searched for duplicate or closed issues
- [X] I have read the contributing guidelines
Describe the issue
There are some inconsistencies in the default icon colors that have made it harder to keep behavior consistent across all icons. The inconsistencies are:
- Which elements the fill color property values are set on. Some set the fill on the
svg, and others on thepathelements. - Which colors are used as the default values for those properties. Some use
'currentColor', others use#6A6976or#252a2e
To resolve these issue and improve icon consistency, I suggest a few changes:
- Use the
fillproperty on thesvgelements inside of the icon components, rather than thepathelements - Default the
fillproperty value to'currentColor'- which means that the fill color of that path will be the same as the color property of the element or its parent element (see example: https://jsfiddle.net/s4c1e2nu/1/) - Use a constant value for the icon default size of
16
Reduced test cases
No response
What operating system(s) are you seeing the problem on?
No response
What browser(s) are you seeing the problem on?
No response
What is the issue regarding ?
@trimble-oss/modus-web-components
What version of npm package are you using ?
Latest
Priority
Medium
What product/project are you using Modus Components for ?
Work Center
What is your team/division name ?
Trimble Viewpoint
Are you willing to contribute ?
Yes
Are you using Modus Web Components in production ?
No response
Hello @ryan-henness-trimble! Thanks for opening an issue. The Modus core team will get back to you soon (usually within 24-hours) and provide guidance on how to proceed. Contributors are welcome to participate in the discussion and provide their input on how to best solve the issue, and even submit a PR if they want to.
Please wait until the issue is ready to be worked on before submitting a PR, or you can reach out to the core team if it is time bound. For trivial things, or bugs that don't change the expected behaviors and UI, you can go ahead and make a PR.
@coliff @msankaran0712 one quick question about the review process - will one of you reach out once this issue has been reviewed by your team?
@ryan-henness-trimble We normally review the issues every Friday and we did refined this today and we are taking it
some rules/changes I have in mind:
- Remove
data-test-idattribute on any SVGs - SVG should have have
fill={props.color ?? 'currentColor'} - Remove any unnecessary groups
<g> - Maybe alphabetize the SVG attributes for consistency
- Set icon name as the class if no class name there already
- Remove any 'empty squares' (
<path d="M0,0H24V24H0Z" fill="none" />)
I'm unsure about changing the default icon size to make them all 16x16 as it could have unintentional side effects if the icons are in use on sites.
@coliff/ @ryan-henness-trimble Can you confirm if this is fixed by Ryan's latest PR?
@coliff Can you validate this ticket is resolved, I think your #1946 does what is mentioned above. Or resolved by the new method for including icons (or at least not broken again by that)
Closing this based on the status.