create-figma-plugin
create-figma-plugin copied to clipboard
get the list of elements in canonical order
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