glmrvn / Appearance-figma-plugin

Figma plugin. This plugin generates a dark/light theme from your selection.
https://www.figma.com/community/plugin/760927481606931799/Appearance
40 stars 15 forks source link

Fix objectLocal lookups #26

Closed jasonlong closed 3 years ago

jasonlong commented 3 years ago

After further debugging my issues, I found the bug. The keys for objectLocal are all the shorter versions without the trailing comma values as set here with the slice:

https://github.com/glmrvn/Appearance-figma-plugin/blob/fa2589403aea2a4dbd9ac31ee2379747ded9838e/code.js#L167-L169

On subsequent lookups, the extension is looking for style matches using the full string and not the sliced version. Doing the same slice on those values fixes the problem