Skip to content

Commit

Permalink
update (style-dictionary): doc the new features
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche committed Aug 22, 2023
1 parent 51cdc7b commit 3114730
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions design-system/style-dictionary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@

~~~
npm install -D style-dictionary
~~~

The following statement initializes the complete environment (not necessary):
~~~
npx style-dictionary init complete
~~~

Replace the `config.json` with our `config.js` to customize transformations, focusing on CSS.
In this case, you must:
* replace the `config.json` with our `config.js` to customize transformations, focusing on CSS;
* replace the initial generated tokens (`token` folder) with our tokens to use them.

## Build

Expand All @@ -23,8 +29,15 @@ npx style-dictionary build --config ./config-classes.js

## Config

* `config.js` - default file: generates only the CSS output with customizations to add the `rem` measure to shape specifications;
* `config-classes.js`: a customized format that loads an extra `classes.json` file and generates `classes-resolved.json`, transforming tokens in their respective values.
* `config.js` -- default file
* `transform`: add specialized measures to the CSS output -- add the `rem` measure to shape specifications;
* `config-classes.js`
* `transform`: add specialized measures to the CSS output -- add the `rem` measure to shape specifications;
* `format`: customized formats that load an extra `classes.json` file and generate:
* `classes/classes-resolved.json`: transforms classes.json tokens in their respective values;
* `css/classes-tokens.css`: transforms in CSS converting first-level properties in CSS classes and tokens to CSS variables;
* `css/classes-resolved.css`: same as the previous, but converting tokens in their respective values;
* `intermediary/aggregated-tokens.json`: an auxiliary file aggregating all tokens in a single hierarchical file.

## Originals

Expand Down

0 comments on commit 3114730

Please sign in to comment.