postcss-custom-properties
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -0,1 +1,6 @@ | ||
# 3.1.0 - 2015-03-16 | ||
- Added: variables defined in JS are now automatically prefixed with `--` | ||
([0691784](https://github.com/postcss/postcss-custom-properties/commit/0691784ed2218d7e6b16da8c4df03e2ca0c4798c)) | ||
# 3.0.1 - 2015-02-06 | ||
@@ -2,0 +7,0 @@ |
11
index.js
@@ -23,3 +23,12 @@ /** | ||
options = options || {} | ||
var variables = options.variables || {} | ||
var userVariables = options.variables || {} | ||
var variables = | ||
Object.keys(userVariables) | ||
.reduce(function(acc, key) { | ||
if (key.indexOf("--") !== 0) { | ||
acc["--" + key] = userVariables[key] | ||
} | ||
acc[key] = userVariables[key] | ||
return acc | ||
}, {}) | ||
var preserve = (options.preserve === true ? true : false) | ||
@@ -26,0 +35,0 @@ var map = {} |
{ | ||
"name": "postcss-custom-properties", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "PostCSS plugin to polyfill W3C CSS Custom Properties for cascading variables", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -72,2 +72,4 @@ # postcss-custom-properties [![Build Status](https://travis-ci.org/postcss/postcss-custom-properties.png)](https://travis-ci.org/postcss/postcss-custom-properties) | ||
Allow you to pass an object of variables for `:root`. These definitions will override any that exist in the CSS. | ||
The keys are automatically prefixed with the CSS `--` to make it easier to share | ||
variables in your codebase. | ||
@@ -74,0 +76,0 @@ --- |
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
11581
156
91