Skip to content

Commit

Permalink
feat: include JS data object in npm dist
Browse files Browse the repository at this point in the history
  • Loading branch information
blackfalcon committed Aug 2, 2019
1 parent 3d6252f commit 00471d1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ The `config.json` file, contained within the `./example/` directory will output
1. Sass
1. Android
1. iOS
1. Sketch (specifically color palette generation)

### Example ./gulpfile.js

Expand Down Expand Up @@ -225,14 +224,16 @@ Located in the [npm](https://www.npmjs.com/package/@alaskaairux/orion-design-tok
└── tokens
├── TokenProperties.css
├── _TokenProperties.scss
└── _TokenVariables.scss
├── _TokenVariables.scss
└── TokenColorVariables.js
```

| file | type | syntax |
|---|---|---|
| TokenProperties.css | CSS Custom Properties | CSS |
| _TokenProperties.scss | CSS Custom Properties | SCSS |
| _TokenVariables.scss | Sass variables | SCSS |
| TokenVariables.js | data | JS |

**To install in Sass file:**

Expand Down
10 changes: 0 additions & 10 deletions example/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@
}
]
},
"sketch": {
"transformGroup": "assets",
"buildPath": "./example/tokensBuild/",
"files": [
{
"destination": "TokenVariables.sketchpalette",
"format": "sketch/palette"
}
]
},
"android": {
"transformGroup": "android",
"buildPath": "./example/tokensBuild/droid/",
Expand Down
15 changes: 15 additions & 0 deletions scripts/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@
}
]
},
"JavaScript": {
"transformGroup": "js",
"buildPath": "./dist/tokens/",
"files": [
{
"destination": "TokenColorVariables.js",
"format": "javascript/object",
"filter": {
"attributes": {
"category": "color"
}
}
}
]
},
"JSONtest": {
"transformGroup": "css",
"buildPath": "./test/",
Expand Down
1 change: 1 addition & 0 deletions scripts/styleDictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ console.log('')
const StyleDictionary = require('style-dictionary').extend('./scripts/config.json');

// Style Dictionary build function
StyleDictionary.buildPlatform('JavaScript');
StyleDictionary.buildPlatform('SassVariables');
StyleDictionary.buildPlatform('CSSCustomElements');
StyleDictionary.buildPlatform('CSSCustomElements_SassFiletype');

0 comments on commit 00471d1

Please sign in to comment.