Skip to content

Commit

Permalink
feat: tranforms tokens via gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
axamei committed May 9, 2022
1 parent 3e93c3a commit a718bae
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/transform-tokens.yml
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
17 changes: 17 additions & 0 deletions transform.config.json
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
}
}
]
}
}
}

0 comments on commit a718bae

Please sign in to comment.