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

chore(examples): adding format helpers example #628

Merged
merged 2 commits into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions examples/advanced/format-helpers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Format Helpers

This example shows how to use the format helper methods to create custom formats.

#### Running the example

First of all, set up the required dependencies running the command `npm install` in your local CLI environment (if you prefer to use *yarn* update the commands accordingly).

At this point, if you want to build the tokens you can run `npm run build`. This command will run the Style Dictionary CLI with the **sd.config.js** as the configuration file and will generate the files in the `build` folder.

#### How does it work?

Starting in version 3.0, Style Dictionary exposes internal helper methods for formats. In the configuration we are defining custom formats using some of those format helper methods.

#### What to look at

The [`sd.config.js`](sd.config.js) file has everything you need to know.
Loading