kaleidocode-app / chroma

A Figma plugin for creating bulk color styles from selection

Home Page:https://www.figma.com/c/plugin/739237058450529919/Chroma-Colors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Layer order:
Screen Shot 2019-08-20 at 10 51 49 AM

Created styles:
image

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.

This is now fixed and will sort it from ascending + largest to smallest regardless of layer order:

gif

Personally, I would expect it to sort alphabetically.

Currently, in my view, it's behaving reversed. Am I the only one?

This is what I get now, but I'd like the resulting styles to match the source layer order.

Resulting Styles

Source Layers

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.