Skip to main content
Solved

Is there a way to get better idea about overrides logic?


Pavel_Kiselev

Hey there

I am struggling to figure out a complexity behind overrides logic. I got a setup that does not work the way I would expect it to work. It seems like Figma is struggling to balance it out, fixing one use case completely ruins another one. Or I am just not smart enough to get it 😉

So here is my thing

  1. I got base component that implements basic shape with rounded corners, I want to reuse it over and over again to keep my radii under control

image

  1. Now I made another component that uses chrome component inside. This other component is supposed to be interactive one, e.g. it has few visual states like rest, hover and selected

image

  1. Now when it is time to use instances I got an issue… So I change the “radii” property to get different rounded corners and at this point there is NO transition from selected state back to normal, rest state.

image

It seems like whenever I change the “chrome” component “radii” property all the other overrides become permanent.

Playground - https://www.figma.com/file/9tdSkbKRcHqNRBr3egqHlX/Untitled?node-id=1%3A117

Would appreciate thought on the matter. Maybe I am doing it wrong? Don’t know!

@Figma_Support you input matters too!

Best answer by tank666

Hey @Pavel_Kiselev, I experimented a bit with your file and I was only able to preserve overrides with boolean union operation. And, as usual, all overrides must be on the “union” layer.

You can see examples in this file:

Figma – 30 Jun 22
View original
This topic has been closed for comments

6 replies

tank666
  • 4857 replies
  • Answer
  • July 5, 2022

Hey @Pavel_Kiselev, I experimented a bit with your file and I was only able to preserve overrides with boolean union operation. And, as usual, all overrides must be on the “union” layer.

You can see examples in this file:

Figma – 30 Jun 22

Pavel_Kiselev
  • Author
  • Power Member
  • 438 replies
  • July 5, 2022

Ace man, much appreciated!

It’s very interesting, seems like making union isolates underlying component that holds the shape, now I do not override underlying component but the shape itself. Seems a bit dirty, but it works, niceeeee =)


Pavel_Kiselev
  • Author
  • Power Member
  • 438 replies
  • July 6, 2022

@tank666 love the way you split the shape into individual components, instance swap property makes it super easy to surface the shape props on a component level!


Amar_Varma

Hi.

Found a quick solution to your problem.

Solution:
Just added outline stroke FFFFFF0% to ◇chrome in ❖interactive-variants/rest.
Explanation & demo in Figma file.

Your issue was new for me too 🤘 Shared my learnings in the figma file.

Me and my team use this basic understanding of overriding in figma. See image attached. Hope this helps

.


tank666
  • 4857 replies
  • July 7, 2022

Hey @Amar_Varma, adding a stroke doesn’t resolve the issue. The stroke still goes to rest state and the hover state is lost after changing the radius variant. You can check in your own file.

And the alternative method with a mask works as expected, but I see a problem with the number of layers in it and consider it not optimal.


Pavel_Kiselev
  • Author
  • Power Member
  • 438 replies
  • July 8, 2022

Thanks for digging into this, much appreciated! Unfortunately, stoke method did not work, I did not find a good reason why it should though 😉 The mask looks promising, will definitely explore

Cheers mate!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings