postcss-custom-properties
Advanced tools
Comparing version 6.0.1 to 6.1.0
@@ -0,1 +1,7 @@ | ||
# 6.1.0 - 2017-06-28 | ||
- Added: Let "warnings" option silence all warnings | ||
([#67](https://github.com/postcss/postcss-custom-properties/pull/67)) | ||
- Dependencies update (postcss, balanced-match) | ||
# 6.0.1 - 2017-05-15 | ||
@@ -2,0 +8,0 @@ |
@@ -23,2 +23,8 @@ "use strict"; | ||
/** | ||
* Module variables | ||
*/ | ||
var globalWarnings = void 0; | ||
/** | ||
* Resolve CSS variables. | ||
@@ -58,3 +64,5 @@ * | ||
if (!variable && !fallback) { | ||
result.warn("variable '" + name + "' is undefined and used without a fallback", { node: decl }); | ||
if (globalWarnings) { | ||
result.warn("variable '" + name + "' is undefined and used without a fallback", { node: decl }); | ||
} | ||
post = matches.post ? resolveValue(matches.post, variables, result, decl) : [""]; | ||
@@ -90,3 +98,5 @@ // resolve the end of the expression | ||
if (!fallback) { | ||
result.warn("Circular variable reference: " + name, { node: decl }); | ||
if (globalWarnings) { | ||
result.warn("Circular variable reference: " + name, { node: decl }); | ||
} | ||
variable.value = [variable.value]; | ||
@@ -149,3 +159,2 @@ variable.circular = true; | ||
function plugin(style, result) { | ||
var warnings = options.warnings === undefined ? true : options.warnings; | ||
var variables = prefixVariables(options.variables); | ||
@@ -158,2 +167,4 @@ var strict = options.strict === undefined ? true : options.strict; | ||
globalWarnings = options.warnings === undefined ? true : options.warnings; | ||
// define variables | ||
@@ -167,3 +178,3 @@ style.walkRules(function (rule) { | ||
var prop = decl.prop; | ||
if (warnings && prop && prop.indexOf(VAR_PROP_IDENTIFIER) === 0) { | ||
if (globalWarnings && prop && prop.indexOf(VAR_PROP_IDENTIFIER) === 0) { | ||
result.warn("Custom property ignored: not scoped to the top-level :root " + `element (${rule.selectors} { ... ${prop}: ... })` + (rule.parent.type !== "root" ? ", in " + rule.parent.type : ""), { node: decl }); | ||
@@ -170,0 +181,0 @@ } |
{ | ||
"name": "postcss-custom-properties", | ||
"version": "6.0.1", | ||
"version": "6.1.0", | ||
"description": "PostCSS plugin to polyfill W3C CSS Custom Properties for cascading variables", | ||
@@ -21,4 +21,4 @@ "keywords": [ | ||
"dependencies": { | ||
"balanced-match": "^0.4.2", | ||
"postcss": "^6.0.1" | ||
"balanced-match": "^1.0.0", | ||
"postcss": "^6.0.3" | ||
}, | ||
@@ -28,7 +28,7 @@ "devDependencies": { | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-preset-env": "^1.4.0", | ||
"babel-preset-env": "^1.5.2", | ||
"babel-register": "^6.24.1", | ||
"eslint": "^3.19.0", | ||
"eslint": "^4.1.1", | ||
"npmpub": "^3.1.0", | ||
"tape": "^4.6.3" | ||
"tape": "^4.7.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "scripts": { |
@@ -0,0 +0,0 @@ # postcss-custom-properties [![Build Status](https://travis-ci.org/postcss/postcss-custom-properties.svg)](https://travis-ci.org/postcss/postcss-custom-properties) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
18203
237
1
+ Addedbalanced-match@1.0.2(transitive)
- Removedbalanced-match@0.4.2(transitive)
Updatedbalanced-match@^1.0.0
Updatedpostcss@^6.0.3