Skip to main content

Unify received properties for strokes

  • January 24, 2023
  • 1 reply
  • 329 views

dotling

Hey guys,
i am new here and want to say first: I love the way we can implement plugins to figma, this is awesome, great work!

I noticed the following:
if I want to check a node to see whether it contains a stroke, I have to query different properties, depending on whether I have a node of type GROUP or FRAME.

For example, if i want to check the node type GROUP for strokes, i am fine with if(node.strokes), because it is undefined if not set. If i check the type FRAME, i have to use if(node.strokes.length), because it is empty but not undefined.

Maybe I’m missing a property that is unique, but it seems to me that this is some kind of a bug?

1 reply

tank666
  • 4873 replies
  • January 24, 2023

GroupNode does not support strokes. You only need to check the nodes to which they can be added. You can find out about supported nodes from the documentation: strokes.


Reply


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