Skip to content

Commit a0baaa6

Browse files
adamstankiewiczPKulkoRaccoonGang
authored andcommitted
feat: added sd-transforms; refs in source-tokens-only output; fixed refs warnings
1 parent 029325a commit a0baaa6

File tree

10 files changed

+440
-179
lines changed

10 files changed

+440
-179
lines changed

lib/build-tokens.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const path = require('path');
22
const minimist = require('minimist');
33
const {
44
initializeStyleDictionary,
5+
getTokensStudioTransforms,
56
colorTransform,
67
} = require('../tokens/style-dictionary');
78
const { createIndexCssFile } = require('../tokens/utils');
@@ -56,9 +57,14 @@ async function buildTokensCommand(commandArgs) {
5657
source: tokensSource
5758
? [`${tokensSource}/core/**/*.json`, `${tokensSource}/core/**/*.toml`]
5859
: [],
60+
preprocessors: ['pgn-annotate-token-extensions-with-references', 'tokens-studio'],
61+
expand: {
62+
typesMap: (await getTokensStudioTransforms()).expandTypesMap,
63+
},
5964
platforms: {
6065
css: {
6166
prefix: 'pgn',
67+
transformGroup: 'paragon-css',
6268
// NOTE: buildPath must end with a slash
6369
buildPath: buildDir.slice(-1) === '/' ? buildDir : `${buildDir}/`,
6470
options: {
@@ -82,7 +88,6 @@ async function buildTokensCommand(commandArgs) {
8288
},
8389
},
8490
],
85-
transforms: StyleDictionary.hooks.transformGroups.css.filter(item => item !== 'size/rem').concat('color/sass-color-functions', 'str-replace'),
8691
},
8792
},
8893
log: {

package-lock.json

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@
5151
"playroom:build": "npm run playroom:build --workspace=www",
5252
"prepare": "husky || true",
5353
"build-tokens": "./bin/paragon-scripts.js build-tokens --build-dir ./styles/css",
54+
"build-tokens:watch": "npx nodemon --ignore styles/css -x \"npm run build-tokens\"",
5455
"replace-variables-usage-with-css": "./bin/paragon-scripts.js replace-variables -p src -t usage",
5556
"replace-variables-definition-with-css": "./bin/paragon-scripts.js replace-variables -p src -t definition",
5657
"cli:help": "./bin/paragon-scripts.js help"
5758
},
5859
"dependencies": {
5960
"@popperjs/core": "^2.11.4",
61+
"@tokens-studio/sd-transforms": "^1.2.4",
6062
"axios": "^0.27.2",
6163
"bootstrap": "^4.6.2",
6264
"chalk": "^4.1.2",

styles/css/core/custom-media-breakpoints.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* See <root>/tokens/README.md for more details.
44
*/
55

6-
@custom-media --pgn-size-breakpoint-min-width-xs (min-width: 0);
6+
@custom-media --pgn-size-breakpoint-min-width-xs (min-width: 0px);
77
@custom-media --pgn-size-breakpoint-max-width-xs (max-width: 576px);
88
@custom-media --pgn-size-breakpoint-min-width-sm (min-width: 576px);
99
@custom-media --pgn-size-breakpoint-max-width-sm (max-width: 768px);

0 commit comments

Comments
 (0)