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

Question about defining token type after upgrading to version 4 #1421

Open
Hai-San opened this issue Dec 19, 2024 · 0 comments
Open

Question about defining token type after upgrading to version 4 #1421

Hai-San opened this issue Dec 19, 2024 · 0 comments

Comments

@Hai-San
Copy link

Hai-San commented Dec 19, 2024

After upgrading my project to version 4, I have a question regarding the definition of token types.

In version 3, I didn’t need to specify the token type individually for each token. However, in version 4, I noticed that the transforms are now looking for the token types in a different path, and I now need to define the type for each token separately.

I would like to know if, in version 4, there is a way to define a token type globally for all tokens in the file, rather than having to define the type for each token individually. I am using .js files to structure my tokens.

For example, the transform color/hsl-4 doesn’t work as expected, and the colors are still being processed in hexadecimal format instead of HSL.

Example:

export default {
  color: {
    base: {
      orange: {
        50: {
          value: '#FEEEE9',
        },
        100: {
          value: '#FCD5C8',
        },
        200: {
          value: '#F9AC92',
        },
        300: {
          value: '#F5835B',
        },
        400: {
          value: '#F25924',
        },
        500: {
          value: '#B2421B',
        },
        600: {
          value: '#732B11',
        },
      },
    }, 
  },   
};    

Token structure output:

{
  value: '#FEEEE9',
  filePath: 'tokens/_base/colors.js',
  isSource: true,
  original: { value: '#FEEEE9' },
  name: 'colorBaseOrange50',
  attributes: { category: 'color', type: 'base', item: 'orange', subitem: '50' },
  path: [ 'color', 'base', 'orange', '50' ],
  key: '{color.base.orange.50}'
}
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