create-figma-plugin icon indicating copy to clipboard operation
create-figma-plugin copied to clipboard

get the list of elements in canonical order

Open leo-martin opened this issue 4 months ago • 1 comments

Hello,

I'm developing a plugin to export content from a figma design and I'm using the traverseNode function. One problem I have with it is the depth first, is it possible to get the list of elements in order ?

for example if my figma file looks like this :

body
  div
   span
   img

I would like to get this list [body, div, span, img] but I'm getting [body, div, img, span]

Is there any function that can help me achieve that?

Thank you

leo-martin avatar Feb 02 '24 16:02 leo-martin