Skip to content

Commit

Permalink
fix: remove spacings transform, add empty transform for pxToRem
Browse files Browse the repository at this point in the history
  • Loading branch information
feerglas committed Aug 3, 2021
1 parent 7e41855 commit f502fea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
Expand Down

0 comments on commit f502fea

Please sign in to comment.