How to preserve icon color override and size?

Thanks @tank666 for your file.

I have two large libraries I’m managing for my team (one for icons, one for UI components) and was struggling to make icon colors work for both dark and light theme for several hours this afternoon. Here’s what worked for me:

  1. Do the Union trick from Rogie’s file: for me, I duplicate my expanded icon in place (cmd+d), then union the two dupes, delete one of them, rename the union item to something like “color_fix”, the icon vector itself to “Union”, and the frame containing it all to the name I want for the icon (e.g. “keyboard”). Convert this to a component if it isn’t one already.
  2. Make sure all the items are set to Scale for height and width
  3. Make sure no color styles are applied anywhere in the stack; just some generic black color or whatever
  4. Publish the icon library
  5. Accept the icon library updates in the UI components library
  6. In the UI components library have a component with two icons in it, one for light theme and one for dark
  7. Use those icon components throughout the UI components library file.
  8. Apply the colors you want to the light icon and dark icon (I applied the color on the level of the item labeled “color_fix”)

Doing all of that enabled me to actually see the icons scale correctly to several different sizes within different components and also reflect the correct color depending on which theme the UI component pertained to.

4 Likes