Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference tokens not correct #293

Open
reivaxui opened this issue Nov 24, 2023 · 11 comments
Open

Reference tokens not correct #293

reivaxui opened this issue Nov 24, 2023 · 11 comments

Comments

@reivaxui
Copy link

reivaxui commented Nov 24, 2023

Hi,
When I generate json tokens, the references are incorrect.

Example :
I have 3 modes "Theme A", "Theme B", "Theme C".
Each value reference take the last mode (theme C)

"value": "{colors.themeC.palette.brand.secondary}"
Reference value must be {colors.themeA.palette.brand.secondary}

  "colors": {
    "themeA": {
      "palette": {
        "brand": {
          "primary": {
            "type": "color",
            "value": "#001944ff",
            "blendMode": "normal"
          }
        }
      },
      "surfaces": {
        "primary": {
          "default": {
            "type": "color",
            "value": "{colors.themeC.palette.brand.secondary}"
          }
        }
      }
    },
    "themeB": {
      "palette": {
        "brand": {
          "primary": {
            "type": "color",
            "value": "#001944ff",
            "blendMode": "normal"
          }
        }
      },
      "surfaces": {
        "primary": {
          "default": {
            "type": "color",
            "value": "{colors.themeC.palette.brand.secondary}"
          }
        }
      }
    },
    "themeC": {
      "palette": {
        "brand": {
          "primary": {
            "type": "color",
            "value": "#001944ff",
            "blendMode": "normal"
          }
        }
      },
      "surfaces": {
        "primary": {
          "default": {
            "type": "color",
            "value": "{colors.themeC.palette.brand.secondary}"
          }
        }
      }
    }
  }
@JackHowa
Copy link
Contributor

I'm seeing this as well

@Franjoo
Copy link

Franjoo commented Dec 20, 2023

Yes, it would be really nice if that could be fixed.

@Franjoo
Copy link

Franjoo commented Jun 19, 2024

Any updates here?

@JulianBissekkou
Copy link

I can also reproduce this. This sadly makes the plugin unusable :/

@lukasoppermann
Copy link
Owner

Sorry I missed this. I will loom into the Pr by @JackHowa to merge it

@lukasoppermann
Copy link
Owner

Hey, I looked into it but it is not as easy as you made it seem. 🤣

@JackHowa can you please just add the needed test to the PR you made? #289

Only the test please. Happy to look into the other PR you closed as a separate one. But I would love the PR to stay as it is and just add a test so I don't have to re-review and can merge it as soon as the test is there. 🙏

@JackHowa
Copy link
Contributor

ah I didn't make that pr linked #289 but I can see if I can make a clean pr for ya

@JackHowa
Copy link
Contributor

here's the updated pr #300. I had to break out some utils so they were easier to test

@lukasoppermann
Copy link
Owner

Okay, I merged and released this now. Can you please test if this fixes it?

@JackHowa
Copy link
Contributor

Okay, I merged and released this now. Can you please test if this fixes it?

Yep works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants