@sproutsocial/seeds-utils
Advanced tools
Comparing version 1.1.0 to 1.2.0
{ | ||
"name": "@sproutsocial/seeds-utils", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Seeds utility functions for generating tokens", | ||
@@ -11,4 +11,5 @@ "seeds_ignore": true, | ||
}, | ||
"author": "Sprout Social", | ||
"gitHead": "10a73c208d1b134ae66cbc86d0f8d223e064f8b6" | ||
"author": "Sprout Social, Inc.", | ||
"license": "MIT", | ||
"gitHead": "a90c3b677fb2d6f00806c6c215ec5dabd525062d" | ||
} |
@@ -110,3 +110,3 @@ const StyleDictionary = require('style-dictionary'); | ||
sassMixin: `${getComponents([pascalCase(category), type, kebabCase(item)], '-', '--')}`, | ||
css: `--${getComponents([category, type, kebabCase(item)], '-', '--')}`, | ||
css: `--${getComponents([category.replace(' ', ''), type, kebabCase(item)], '-', '--')}`, | ||
app: `${pascalCase(type)}${includeItem ? ` ${item}` : ''}`, | ||
@@ -184,2 +184,17 @@ javascript: `${getComponents([constantCase(category), constantCase(type), constantCase(item)], '_', '_')}`, | ||
StyleDictionary.registerTransform({ | ||
name: 'value/motion', | ||
type: 'value', | ||
matcher: function(props) { | ||
return props.attributes.category.includes('motion'); | ||
}, | ||
transformer: function(props) { | ||
if (props.attributes.type === 'duration') { | ||
return parseFloat(props.value.replace(/s/g, '')); | ||
} else { | ||
return "'" + props.value + "'"; | ||
} | ||
} | ||
}); | ||
StyleDictionary.registerFormat({ | ||
@@ -186,0 +201,0 @@ name: 'ase', |
@@ -16,2 +16,7 @@ const Handlebars = require('handlebars'); | ||
// Used to format RGB values from 0-255 to 0-1 | ||
Handlebars.registerHelper('rgb', function(value) { | ||
return value / 255; | ||
}); | ||
// Return the compiled Handlebars template for a given template file name | ||
@@ -34,3 +39,4 @@ function getTemplateForFile(file) { | ||
'space-css': 'space-css.hbs', | ||
'space-json': 'space-json.hbs' | ||
'space-json': 'space-json.hbs', | ||
sketch: 'sketch.hbs' | ||
}; | ||
@@ -37,0 +43,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
20849
20
377
0