Skip to main content
Alina_Trussova
New Participant
Sep 8, 2023 8:34 AM UTC
Solved

Nested component, instance swap and stroke scaling issue

Icon stroke width behaves as expected inside the button (it scales with the canvas). However, as soon as it’s turned into a component and the icon is swapped, the stroke resets to a default value of 2px. The frame size behaves as expected.
Icon is resized using scale tool.

Problem appears both ways:
– creating button from scratch (works), make is a component (does not work).
– creating button component with same anatomy from scratch (does not work). Detach the same component (works).

Creating different sizes with variants for each icon is not an option due to the extensive icon library.

Is this a bug, or what could be causing this issue?

    This topic has been closed for replies.
    tank666
    tank666Solution
    Sep 8, 2023 2:51 PM UTC

    Most likely you need to override the icon stroke weight in each button variant.

    UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank

    26 replies

    tank666
    Sep 8, 2023 1:13 PM UTC
    UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
    Alina_Trussova
    New Participant
    Sep 8, 2023 2:26 PM UTC

    Thanks!
    – Icons are constructed properly (flatten, only one vector stroke layer and the same layer names, same properties)
    – Also I did try creating a component responsible for size (3 sizes). It exhibits the same behaviour. When used in a button component stroke resizes back to original 2px.

    Seems like a component adds additional parameters to the setup, but I can not figure out what and do I even have control over it. Currently it’s seems like a bug to me.
    Does anybody have any ideas?

    tank666
    tank666Solution
    Sep 8, 2023 2:51 PM UTC

    Most likely you need to override the icon stroke weight in each button variant.

    UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
    Alina_Trussova
    New Participant
    Sep 8, 2023 3:21 PM UTC

    I see! That’s what I was missing! Highly appreciate your help.

    Jay_Flaxman
    New Member
    Nov 10, 2023 4:49 PM UTC

    Surely this is still a bug though? I have the same issue where I’ve created a component in which I’ve added an instance swap property for a nested component that I’ve scaled up. As soon as I try swapping the instance of the nested component, the stroke thickness reverts back to the original. If the original instance is scaled, why would the scale not apply to the swapped instance?

    Lucas_del_Rio
    Nov 16, 2023 8:25 PM UTC

    This is a bug clearly. Been struggling these paste days with the same issue. Makes no sense honestly.

    Alina_Trussova
    New Participant
    Nov 27, 2023 7:47 AM UTC

    Hi! I have been testing and noticed that I do not experience this problem anymore even without workaround.
    So it looks like the bug is fixed now and maybe latest Figma update will help?

    Mads_Hensel_dk
    Mar 15, 2024 1:22 PM UTC

    Ran into this problem/bug again today, so I don’t think it’s been fixed yet!

    Amy_Martens
    Mar 15, 2024 1:35 PM UTC

    This definitely still happens and causes a lot of pain trying to use stroke based icon libraries with a design system built in Figma

    Mar 26, 2024 6:02 PM UTC

    Still same issue, If ikon or illustration with stokes in nested level inside a parent component. Stroke will not scale if instance is scaled small or bigger.