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

Filter out undefined styles #25

Closed jasonlong closed 3 years ago

jasonlong commented 3 years ago

I was running into a problem where running the extension in a file using an external style library was hanging. I don't know how common this is, but I noticed a bunch of 404s in the console:

CleanShot 2021-06-11 at 09 30 40@2x

Debugging the extension, I found that some of the styles in the allStyles array were undefined (perhaps related to the 404s?). Filtering these out before iterating fixed my problem so I thought I'd propose this change.

jasonlong commented 3 years ago

Ok, I figured out that the 404s were because Figma apparently doesn't export styles named with leading underscores. I'm still having other problems which I'll keep investigating, but closing this for now.