From f502fea12b8c550c54c98d18e47671498b6da857 Mon Sep 17 00:00:00 2001 From: Yves Tscherry Date: Tue, 3 Aug 2021 09:45:05 +0200 Subject: [PATCH] fix: remove spacings transform, add empty transform for pxToRem --- build.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build.js b/build.js index 299fd099..7faa2321 100644 --- a/build.js +++ b/build.js @@ -2,13 +2,16 @@ const StyleDictionary = require('style-dictionary') .extend(`${__dirname}/config.js`); const fs = require('fs'); const _ = require('lodash'); -const spacingTokens = require('./designTokens/spacing'); -const baseSpacing = spacingTokens.base.value; +// Transform to calculate rem from pixel values based on basePxFontSize StyleDictionary.registerTransform({ - matcher: (token) => token.attributes.category === 'spacing', - name: 'calculateSpacings', - transformer: (token) => token.value * baseSpacing, + matcher: (token) => { + console.log(token.attributes.category); + + return token.attributes.category === 'size'; + }, + name: 'size/pxToRem', + transformer: (token) => token.value, transitive: true, type: 'value' });