amzn / style-dictionary

A build system for creating cross-platform styles.
https://styledictionary.com
Apache License 2.0
3.87k stars 543 forks source link

Transformer with Vanilla Extract lib #985

Open JackHowa opened 1 year ago

JackHowa commented 1 year ago

Hello! I've been a fan and used this repo. But I'm curious if people have used this for generating variables or even themes in Vanilla Extract, form the creator of CSS Modules: https://vanilla-extract.style/documentation/api/create-var/

For example, outputting ...

import { createVar, style } from '@vanilla-extract/css';

export const accentVar = createVar();

export const blue = style({
  vars: {
    [accentVar]: 'blue'
  }
});

from


{
  "accentColor" : {
    "$value": "blue",
    "$type": "color"
   }
}