From 52057f03310c66910fd5d4a91298137945403414 Mon Sep 17 00:00:00 2001 From: Brad Paugh Date: Wed, 31 May 2023 17:19:35 -0700 Subject: [PATCH] fix: radius percent output in % --- build.js | 1 + config.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.js b/build.js index ea42a33..2494e47 100755 --- a/build.js +++ b/build.js @@ -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)) { diff --git a/config.js b/config.js index 9937862..0032d20 100644 --- a/config.js +++ b/config.js @@ -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/',