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

Nested defaults #11

Closed
jkinley opened this issue Jun 14, 2023 · 4 comments
Closed

Nested defaults #11

jkinley opened this issue Jun 14, 2023 · 4 comments

Comments

@jkinley
Copy link

jkinley commented Jun 14, 2023

I was wondering 'style-dictionary-utils' can support nested default values like here: amzn/style-dictionary#716

I am trying to do something like this so that token names don't have to have "default" appended:

color: {
    "$type": 'color',
    background: {
      primary: {
        '@': {"$value": '{core.color.brand-blue.500}'},
        light: {"$value": '{core.color.brand-blue.200}'},
        dark: {"$value": '{core.color.brand-blue.800}'},
      },

This is currently breaking for me:

image
@lukasoppermann
Copy link
Owner

Hmm, are you sure this is breaking because of the @?

Can you create a codesandbox.io or codepen.io so we can test with your config and file setup?

@jkinley
Copy link
Author

jkinley commented Jun 15, 2023

If I continue to have issues. I will try that and get back to you. Thanks!

@jkinley
Copy link
Author

jkinley commented Jun 15, 2023

UPDATE

I figured it out. My problem came when referencing the token. I was not including the "@" when referencing. See here for more details: amzn/style-dictionary#119. Also, it looks like a lot of people want a better way to do this in SD 4.0. Here is what worked for me:

Screenshot 2023-06-15 at 8 40 06 AM Screenshot 2023-06-15 at 8 40 52 AM

@jkinley
Copy link
Author

jkinley commented Jun 16, 2023

Thanks again for the help!

@jkinley jkinley closed this as completed Jun 16, 2023
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

2 participants