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

Support Global Token Reference After CSS Variable Conversion #1361

Open
sakit0 opened this issue Oct 6, 2024 · 0 comments
Open

Support Global Token Reference After CSS Variable Conversion #1361

sakit0 opened this issue Oct 6, 2024 · 0 comments

Comments

@sakit0
Copy link

sakit0 commented Oct 6, 2024

Summary:
I would like to propose an enhancement where tokens can reference global tokens after CSS variable conversion. The goal is to ensure that when a token references a global token (e.g., a color variable like white), the reference to that global token is preserved during the conversion process.


Current behavior:
Global tokens are defined separately from light theme tokens.

For example

GlobalToken.json

{
  "white": {
    "$type": "color",
    "$value": "#ffffff"
  }
}

Light.json

{
  "primary": {
    "$type": "color",
    "$value": "{white}"
  }
}

The current output in CSS looks like this:

:root {
  --white: #ffffff;
  --primary: #000000;
}

Expected behavior:
The primary token should reference the global white token, so the ideal CSS output should look like this:

:root {
  --white: #ffffff;
  --primary: var(--white);
}

This enhancement would improve token management by ensuring references between tokens are maintained across themes and token files, making the system more modular and scalable.

Or is there a way to achieve this?

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

1 participant