amzn / style-dictionary

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

Separator in my-format style dicctionary #935

Open f1to47 opened 1 year ago

f1to47 commented 1 year ago

I'm using the Style Dictionary and have created my own format, but it compiles the tokens with a "," separation and I need it to be ";"

`let shadowTokens = dictionary.allTokens.map(token => { if(token.type === 'boxShadow'){

          let props = []
          Object.entries(token.value).forEach(([key, value]) => {

            props = [...props, `--${token.name}-${key}:${value}`]
          });

          console.log(props)

    }

    }).join('');`

The result is:

--shadow-1-x:0,--shadow-1-y:2,--shadow-1-blur:7,--shadow-1-spread:0,--shadow-1-color:#00000080,--shadow-1-type:dropShadow--shadow-2-x:0,--shadow-2-y:2,--shadow-2-blur:12,--shadow-2-spread:0,--shadow-2-color:#00000080,--shadow-2-type:dropShadow

pedroresende commented 1 year ago

@f1to47 change

}).join('');

by

}).join(';\n');
f1to47 commented 1 year ago

@f1to47 change

}).join('');

by

}).join(';\n');

Thanks!