Inwerpsel / use-theme-editor

A React theme editor
GNU General Public License v3.0
4 stars 0 forks source link

Chains of variables are not properly resolved in (group and variable control) previews if their value doesn't come from the root scope #33

Closed Inwerpsel closed 3 months ago

Inwerpsel commented 1 year ago

Currently these previews depend on the same variables being set in the root scope of the theme editor. This doesn't work if a more specific scope is used to assign the value.

Should be fixed by "manually" resolving these values in the previews. (for some reason snipping tool made everything lighter 😕 ) varnotresolved

This example is a local snapshot taken from https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/Math. This could actually be a separate issue, as it seems to assign the wrong value, rather than not finding the right one.

While in this case the variable control does show the right value, I remember running into cases where both were unable.

It's only the preview, though, if you open the referenced variable, it does already have the correct value. The latter might be a separate issue from the group level previews.

Inwerpsel commented 3 months ago

https://github.com/Inwerpsel/use-theme-editor/commit/2dc4ae100518ea387a82b760a136765fca8bc272