postcss-beard-colors
Advanced tools
Comparing version 0.0.1 to 0.0.2
43
index.js
@@ -5,30 +5,31 @@ var postcss = require('postcss') | ||
var prefixes = { | ||
bg: 'background-color', | ||
tc: 'color', | ||
bc: 'border-color', | ||
bg: 'background-color', | ||
tc: 'color', | ||
bc: 'border-color', | ||
f: 'fill', | ||
} | ||
module.exports = postcss.plugin('postcss-beard-colors', function(opts) { | ||
opts = opts || {} | ||
opts = opts || {} | ||
var colors = opts.colors | ||
var colors = opts.colors | ||
return function(root, result) { | ||
var rules = _.flatMap(prefixes, function(declProp, prefixKey) { | ||
return _.flatMap(colors, function(colorValue, colorKey) { | ||
return postcss | ||
.rule({ | ||
selector: `.${prefixKey}${colorKey}`, | ||
}) | ||
.append( | ||
postcss.decl({ | ||
prop: declProp, | ||
value: colorValue, | ||
return function(root, result) { | ||
var rules = _.flatMap(prefixes, function(declProp, prefixKey) { | ||
return _.flatMap(colors, function(colorValue, colorKey) { | ||
return postcss | ||
.rule({ | ||
selector: `.${prefixKey}${colorKey}`, | ||
}) | ||
.append( | ||
postcss.decl({ | ||
prop: declProp, | ||
value: colorValue, | ||
}) | ||
) | ||
}) | ||
) | ||
}) | ||
}) | ||
}) | ||
root.append(rules) | ||
} | ||
root.append(rules) | ||
} | ||
}) |
{ | ||
"name": "postcss-beard-colors", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "PostCSS plugin to generate utility helpers from a color scale", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
3545
41