-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: registers sd-transforms; includes refs in source-tokens-only output; resolves refs warnings #3219
feat: registers sd-transforms; includes refs in source-tokens-only output; resolves refs warnings #3219
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ const path = require('path'); | |
const minimist = require('minimist'); | ||
const { | ||
initializeStyleDictionary, | ||
getTokensStudioTransforms, | ||
colorTransform, | ||
} = require('../tokens/style-dictionary'); | ||
const { createIndexCssFile } = require('../tokens/utils'); | ||
|
@@ -56,9 +57,14 @@ async function buildTokensCommand(commandArgs) { | |
source: tokensSource | ||
? [`${tokensSource}/core/**/*.json`, `${tokensSource}/core/**/*.toml`] | ||
: [], | ||
preprocessors: ['pgn-annotate-token-extensions-with-references', 'tokens-studio'], | ||
expand: { | ||
typesMap: (await getTokensStudioTransforms()).expandTypesMap, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [inform] See There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Relates to #3222 |
||
}, | ||
platforms: { | ||
css: { | ||
prefix: 'pgn', | ||
transformGroup: 'paragon-css', | ||
// NOTE: buildPath must end with a slash | ||
buildPath: buildDir.slice(-1) === '/' ? buildDir : `${buildDir}/`, | ||
options: { | ||
|
@@ -82,7 +88,6 @@ async function buildTokensCommand(commandArgs) { | |
}, | ||
}, | ||
], | ||
transforms: StyleDictionary.hooks.transformGroups.css.filter(item => item !== 'size/rem').concat('color/sass-color-functions', 'str-replace'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [inform] abstracted into It seems the primary reason it was filtered out was due to tokens that defined a number while having a --pgn-spacing-card-columns-count: 3; |
||
}, | ||
}, | ||
log: { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[inform] See docs on preprocessors.
pgn-annotate-tokens-with-references
is custom.See
sd-transforms
README for more information on thetokens-studio
preprocessor.