Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
fix: radius percent output in %
Browse files Browse the repository at this point in the history
  • Loading branch information
braddialpad committed Jun 1, 2023
1 parent 268fdf4 commit 52057f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ StyleDictionary.registerTransform({
},
transformer: (token, options) => {
const baseFont = getBasePxFontSize(options);
if (token.value.toString().endsWith('%')) { return token.value };
const floatVal = parseFloat(token.value);

if (isNaN(floatVal)) {
Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const getStyleDictionaryConfig = (theme) => {
],
},
css: {
transforms: ['dt/size/pxToRem', 'dt/space/pxToRem', 'dt/fonts/transformToStack', 'dt/lineHeight/percentToDecimal', 'attribute/cti', 'name/cti/kebab', 'time/seconds', 'content/icon', 'size/rem', 'color/css'],
transforms: ['dt/size/pxToRem', 'dt/space/pxToRem', 'dt/fonts/transformToStack', 'dt/lineHeight/percentToDecimal', 'attribute/cti', 'name/cti/kebab', 'time/seconds', 'content/icon', 'color/css'],
actions: ['buildDocJson'],
prefix: 'dt',
buildPath: 'dist/css/',
Expand Down

0 comments on commit 52057f0

Please sign in to comment.