-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: tranforms tokens via gh actions
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Transform tokens | ||
on: | ||
push: | ||
branches-ignore: | ||
- 'main' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v2.4.0 | ||
# Transform Figma Tokens JSON to something Style Dictionary can read (Global only) | ||
- run: npx token-transformer data/tokens.json data/transformed-tokens.json global -y | ||
# Convert tokens according to Style Dictionary config | ||
- run: npx style-dictionary build --config transform.config.json | ||
# Add files that were created during a run, e.g. created files from style dictionary or token-transformer. | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Update and transform tokens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"source": ["data/transformed-tokens.json"], | ||
"platforms": { | ||
"css": { | ||
"transformGroup": "scss", | ||
"files": [ | ||
{ | ||
"destination": "scss/variables.scss", | ||
"format": "scss/variables", | ||
"options": { | ||
"outputReferences": true | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |