Skip to main content
dotling
January 24, 2023

Unify received properties for strokes

  • January 24, 2023
  • 1 reply
  • 367 views

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
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.

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