Order of styles not based on layer order
wilsonminer opened this issue · comments
In the readme example the created styles appear to be in the order they appear in the layer palette. This is the behavior I would expect. When I use the plugin they appear in a different order when created in the styles palette, and I need to manually reorder them to recreate the intended order.
This is actually a bug in the sorter logic, it should sort from largest to smallest. From the Figma API there is no guarantee that the layers will always be in the layer order.
I'll fix the sorting bug.
All I had to do was make a clone of the plugin, and comment out the "ref.reverse();" line out of the .js and .ts files, then load that version of the plugin and it now behaves the way I need it.
Perhaps others find this useful, or is it possible to provide an option?
Thanks a bunch! :)
@nimbling I created a separate issue for this, feel free to create new issues for feature requests 😄
@nimbling I've removed the reverse sort and will re-add this as an option later.