Socket
Socket
Sign inDemoInstall

postcss-custom-properties

Package Overview
Dependencies
10
Maintainers
3
Versions
85
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.1 to 6.1.0

6

CHANGELOG.md

@@ -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 @@

19

dist/index.js

@@ -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)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc