Skip to main content

Previously, 0px or 0.00001px wide layers did not take up any space inside an Auto layout frame. This made it possible to hide elements for smart animate, or use only X or Y.


This changed with the latest update and all elements are pushed 1px, but the parent frame does not expand to “hug” the new size, resulting in 1px offsets wherever these are used.


Hello All,

I am also experiencing the same problem with Figma’s latest desktop application. Autolayout recognizes zero frames. My goal is to create a strikethrough text effect using the zero-height/frame hack.


Here is what’s happening


Any help would be greatly appreciated


Thanks,

Sachin


@SachInteractz, you are using zero-frame incorrectly. And in general, it is no longer necessary to use it in your case. Just select the line and set its absolute position.



Hi @SachInteractz,


Like @tank666 said, I think you’re using them wrong:



  • Using a 0 frame in Height on a Horizontal auto-layout… In this case, you would actually need/want to use a 0 width frame. But like @tank666 said, you don’t need to use this technique anymore, you can just use absolute positioning 🙂


Thank you @tank666 and @Bruno_Garcia1 absolute positioning is the best approach here.



Hey, I was just digging throughAuto Layout Tips & Hacks by @Gleb and found that in his strikethrough example he is also using a zero-height hack. When I copied the same frame and pasted it to my file the auto layout broke as it recognized zero-frame.


Here is what’s happening


Could anyone explain this to me?


Thanks,

Sachin


One can use zero-height in a but the direction has to be vertical.


Your problem is that you are using Auto Layout’s horizontal direction instead of vertical.


You need to set Auto Layout direction to Vertical. To understand the zero-height frames better watch my Config talk:




But you don’t need to use zero-frames anymore since auto layout now supports absolute position.


Yeah Thanks, @Gleb, and @tank666 you guys are awesome


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.