ads-scss-tokens-node
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "ads-scss-tokens-node", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "tokens.scss", |
# js-tokens-to-scss | ||
This package is a POC of converting JS-based Design Tokens into a SCSS file that displays the values of the tokens as SASS vars. | ||
# Todo | ||
1. Need to look at namespacing vars: | ||
eg. $primary is too vague in a SCSS context; probably need $ads-primary |
@@ -0,3 +1,14 @@ | ||
var PREFIX = 'ads'; | ||
var dict = require('./dictionary.js'); | ||
/* | ||
POC of using a lookup table to convert vars to Mendix equivalents | ||
*/ | ||
function validateKey(key){ | ||
return dict[key] || key; | ||
} | ||
function makeScssVar(name, value) { | ||
return `$${name}: #${value};`; | ||
return `$${PREFIX}-${validateKey(name)}: #${value};`; | ||
} | ||
@@ -4,0 +15,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
3955
6
65
10