Vector fill color (nested component) doesn't change back to the one specified in the default variant after interaction

Hey @tank666, thanks for sharing the file. It really helped me realize how color overrides can consistently work. However, there seems to be an issue with stroke properly swapping.

I tried applying it to our design system but I’ve stumbled upon an issue with the stroke not scaling back properly when you change the icon and swap back from Button Large to Medium, and then Small.

What’s peculiar is that stroke swaps properly from Small to Large, and from Large to Medium, but doesn’t go back to 1pt when swapping to Small.

Here’s how it breaks:

Any idea how to handle this?

I fixed this by overriding the stroke weight in the button variants. That is, I selected the icon vector in the Button Components Set, changed the stroke weight from 1px to 2px and back. I did this for all button variants, but maybe it only needed to be done for the Small Button.

Feel free to duplicate my file again to make sure it works as expected:

Thanks @tank666 but I’m unable to edit it even if I save it to my drafts (or launch a prototype to test for that matter).

Is it locked in some way? The old file was editable.

Could you show a screenshot of the entire screen?

I think I duplicated it with one account and tried accessing it with another :sweat_smile:

Sorry and thanks!

Hello Team,
I followed all the received solutions in this thread but so far no luck… Pls find below screen capture.

I have a .base button
I created variants with the help of .base button, those are enabled, hover, active and disabled.
Right n Left icon color working fine with Enabled but
Once I changed the state to disabled or active, icon color reverts to it’s original

Looking for support to maintain the same color irrespective of state change.

Thanks …

Finally, after hours of confusion. This method works for me, thank you so much!

My findings around the topic - Component Properties & Variants Bug - #60 by Pavel_Kiselev

Few conclusions

  • icons can be complex, no need to use ugly hacks, however the visual attributes should be set on a top level union or substract layer
  • naming is important
  • each state should override the attributes you are aiming for

@tank666 Know that you are the person who I love the must today. Thank you so much.

The union works but makes the prototype really slow…

This technique works, I used it today to resolve a range of components using icons that were misfiring across all of our team’s prototypes. @tank666 thank you for sharing!