Skip to content

Commit

Permalink
fix: is taking over pr suggestions and adding additional documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius Bleuer committed Jul 27, 2021
1 parent 85750dc commit b8bb736
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
6 changes: 2 additions & 4 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ const StyleDictionary = require('style-dictionary')
.extend(`${__dirname}/config.js`);
const fs = require('fs');
const _ = require('lodash');
const tokens = require('./designTokens');
const {
baseSpacing
} = tokens.core;
const tokens = require('./designTokens/core/spacings');
const baseSpacing = tokens.base.spacing.value;

StyleDictionary.registerTransform({
matcher: (token) => token.attributes.type === 'spacings',
Expand Down
1 change: 0 additions & 1 deletion designTokens/core/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
baseSpacing: 4,
color: require('./color'),
spacings: require('./spacings')
};
19 changes: 18 additions & 1 deletion designTokens/core/spacings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/* eslint sort-keys: 0 */
/*
* Aside from the base definition, the number assigned to the value is
* representing the factor by which the base value will get multiplied by
* to create the actual spacing size (e.g. spacing-3x: 8 * 4 = 32). The
* transformation is happening in the calculateSpacings transformation
* inside of the build.js file.
*/

/* eslint-disable sort-keys */
module.exports = {
'base': {
spacing: {
value: 4,
attributes: {
type: ''
}
}
},
'fixed': {
'spacing': {
value: 1
Expand Down Expand Up @@ -145,3 +160,5 @@ module.exports = {
}
}
};

/* eslint-enable sort-keys */

0 comments on commit b8bb736

Please sign in to comment.