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

A json source for style dictionary #288

Closed
romainmenke opened this issue Sep 22, 2022 · 2 comments
Closed

A json source for style dictionary #288

romainmenke opened this issue Sep 22, 2022 · 2 comments
Assignees
Labels

Comments

@romainmenke
Copy link
Contributor

romainmenke commented Sep 22, 2022

For postcss-design-tokens we currently have support for Style Dictionary as a source format.

(we would love to support the new format, but the latest draft has too many open issues)


I tried to use open props with the design-tokens.json exported file but the JSON is flattened and the token names have -- prefixes.

Screenshot 2022-09-22 at 11 00 03

In Style Dictionary format this could look like :

{
  "radius": {
    "1": {
      "value": "2px"
    },
    "2": {
      "value": "5px"
    },

This is not the output from using the Style Dictionary CLI to convert to CSS,SCSS,...
It would be the Style Dictionary format itself.

@design-tokens url(node_modules://open-props/design-tokens) format('style-dictionary3');

.foo {
        /* works today: */
	color: design-token('--blue-1')
	/* would be nice to have: */
	color: design-token('blue.1')
}

related : tokencss/tokencss#10 (comment)

I noticed that tokencss doesn't follow the new format (yet) and is closer to Style Dictionary.
So this might be two fixes in one :)

@argyleink
Copy link
Owner

two in one sounds very nice! one of the reasons I dont ship Style Dictionary format is because there's so many props that wouldnt convert to other platforms. but maybe i could ship the props anyway and let folks use them for web and not cross platform?

regardless, it's a transform on the data and i've already got pipelines for exporting various formats. open props can def ship another format, especially if it'll dual resolve a couple use cases 👍🏻

@argyleink argyleink added the enhancement New feature or request label Sep 22, 2022
@argyleink argyleink self-assigned this Sep 22, 2022
@argyleink
Copy link
Owner

fixed by #433

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

No branches or pull requests

2 participants