Skip to content

Commit

Permalink
feat: registers Tokens Studio transforms; build-tokens:watch NPM script
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz committed Sep 7, 2024
1 parent 029325a commit a68f6df
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 162 deletions.
3 changes: 3 additions & 0 deletions lib/build-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ async function buildTokensCommand(commandArgs) {
source: tokensSource
? [`${tokensSource}/core/**/*.json`, `${tokensSource}/core/**/*.toml`]
: [],
preprocessors: ['tokens-studio'],
transforms: ['name/kebab'], // <-- add a token name transform for generating token names, default is camel
platforms: {
css: {
prefix: 'pgn',
transformGroup: 'tokens-studio',
// NOTE: buildPath must end with a slash
buildPath: buildDir.slice(-1) === '/' ? buildDir : `${buildDir}/`,
options: {
Expand Down
64 changes: 64 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@
"playroom:build": "npm run playroom:build --workspace=www",
"prepare": "husky || true",
"build-tokens": "./bin/paragon-scripts.js build-tokens --build-dir ./styles/css",
"build-tokens:watch": "npx nodemon --ignore styles/css -x \"npm run build-tokens\"",
"replace-variables-usage-with-css": "./bin/paragon-scripts.js replace-variables -p src -t usage",
"replace-variables-definition-with-css": "./bin/paragon-scripts.js replace-variables -p src -t definition",
"cli:help": "./bin/paragon-scripts.js help"
},
"dependencies": {
"@popperjs/core": "^2.11.4",
"@tokens-studio/sd-transforms": "^1.2.4",
"axios": "^0.27.2",
"bootstrap": "^4.6.2",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion styles/css/core/custom-media-breakpoints.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* See <root>/tokens/README.md for more details.
*/

@custom-media --pgn-size-breakpoint-min-width-xs (min-width: 0);
@custom-media --pgn-size-breakpoint-min-width-xs (min-width: 0rem);
@custom-media --pgn-size-breakpoint-max-width-xs (max-width: 576px);
@custom-media --pgn-size-breakpoint-min-width-sm (min-width: 576px);
@custom-media --pgn-size-breakpoint-max-width-sm (max-width: 768px);
Expand Down
Loading

0 comments on commit a68f6df

Please sign in to comment.