Skip to main content
Yuan_Chang
March 4, 2021
Question

How to preserve icon color override and size?

  • March 4, 2021
  • 25 replies
  • 16761 views

I have been trying to find a way to preserve the icon color override within my button component. As you can see here, I used the trick from Rogie (Perserve Icon Color Override) to apply union to the icon, and everything seems work.
Screen Shot 2021-03-04 at 8.24.52 AM

However, now when I swap an icon, the union makes it hard to control the icon size (even though all icons have a frame 24x24, the content inside are vary). It then affects the auto layout and size of the component. Therefore, I tried to add another frame to contain the union layer and set fixed size, but it still didn’t work at all.

With the old approach, which I have to change the color every time, it allows me to constrain the icon size within the button to be 16x16. I am wondering is there a better way to preserve both color override and icon size?

This topic has been closed for replies.

25 replies

Dan15
December 7, 2022

Also, just fyi as a vet with 17 years design experience and who builds libraries every other month - these hacks don’t work. They work in specific cases for small libraries with zero variants or states.

Jairo
January 5, 2023

Hello, i would like to share my two cents on this topic in hope it helps someone.

Figma – 19 Dec 22

This is a file i created to explain the problem where you can have a component with an Icon and some text, and how when you manipulate the icon within another main component, it no longer switches variants correctly.

However, if you change the icon on an instance of the second main component, then it hovers correctly.

(I am super bad at explaining, you better grab the file and see it yourself.)

Thing is that i reported it to customer care, and it is a known bug that may (or may not) be fixed this month.

Dominic
Active Member
January 9, 2023

This is a known bug for ages. I recently came back to a previous design system that was working 100%, only to now have same issue again.
My solution (to the solutions mentioned in thread link below) was to Reset all changes to the icon components (layer) in my button masters, dropdowns, menus etc… I then had to set icon sizing inside them to where it was before. Luckily I use master componentents, but this is an embarrassment that Figma hasn’t fixed this, or worse patronizes professionals saying that it has.

Check out this thread if you haven’t tried the layer naming, unique color for icons set stuff first:

Mike_Escoffery
New Participant
September 14, 2023

This isn’t an answer to the original problem. You’ve changed the colour on the Instance level of the button. If you swap the icon to a different one, it does retain the colour of the current instance.

The scenario we are trying to solve is to recolour the Master Component Icon colour, and have it update every single instance of that component. So If I have a Car Icon in my master component, then create an instance of the master and change the icon inside the instance to Dog. Now go back to the master component and change the colour of the car. The Dog instance remains in it’s old colour, even thought we didn’t override the colour in the instance.

Sebas
New Member
March 18, 2024

That update is the real solution!

I had to revise each vector object in every main component, flatten them, give them the same name, and make them the same color variable.
After that, they all worked 😃

@KubaA, u da real MVP