postcss-custom-properties
Advanced tools
Comparing version 8.0.8 to 8.0.9
# Changes to PostCSS Custom Properties | ||
### 8.0.9 (November 5, 2018) | ||
- Fixed: Issue with duplicate custom property usage within a declaration | ||
### 8.0.8 (October 2, 2018) | ||
@@ -4,0 +8,0 @@ |
@@ -5,6 +5,6 @@ 'use strict'; | ||
var postcss = _interopDefault(require('postcss')); | ||
var valueParser = _interopDefault(require('postcss-values-parser')); | ||
var fs = _interopDefault(require('fs')); | ||
var path = _interopDefault(require('path')); | ||
var postcss = _interopDefault(require('postcss')); | ||
@@ -300,8 +300,15 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { | ||
// conditionally replace a known custom property | ||
child.replaceWith(...asClonedArrayWithBeforeSpacing(customProperties[name], child.raws.before)); | ||
retransformValueAST(root, customProperties, name); | ||
const nodes = asClonedArrayWithBeforeSpacing(customProperties[name], child.raws.before); | ||
child.replaceWith(...nodes); | ||
retransformValueAST({ | ||
nodes | ||
}, customProperties, name); | ||
} else if (fallbacks.length) { | ||
// conditionally replace a custom property with a fallback | ||
const index = root.nodes.indexOf(child); | ||
root.nodes.splice(index, 1, ...asClonedArrayWithBeforeSpacing(fallbacks, child.raws.before)); | ||
if (index !== -1) { | ||
root.nodes.splice(index, 1, ...asClonedArrayWithBeforeSpacing(fallbacks, child.raws.before)); | ||
} | ||
transformValueAST(root, customProperties); | ||
@@ -308,0 +315,0 @@ } |
{ | ||
"name": "postcss-custom-properties", | ||
"version": "8.0.8", | ||
"version": "8.0.9", | ||
"description": "Use Custom Properties Queries in CSS", | ||
@@ -14,8 +14,8 @@ "author": "Jonathan Neal <jonathantneal@hotmail.com>", | ||
"main": "index.cjs.js", | ||
"module": "index.es.mjs", | ||
"module": "index.esm.mjs", | ||
"files": [ | ||
"index.cjs.js", | ||
"index.cjs.js.map", | ||
"index.es.mjs", | ||
"index.es.mjs.map" | ||
"index.esm.mjs", | ||
"index.esm.mjs.map" | ||
], | ||
@@ -41,7 +41,7 @@ "scripts": { | ||
"babel-eslint": "^10.0.1", | ||
"eslint": "^5.6.1", | ||
"eslint": "^5.8.0", | ||
"eslint-config-dev": "^2.0.0", | ||
"postcss-tape": "^2.2.0", | ||
"pre-commit": "^1.2.2", | ||
"rollup": "^0.66.2", | ||
"rollup": "^0.67.0", | ||
"rollup-plugin-babel": "^4.0.3" | ||
@@ -48,0 +48,0 @@ }, |
@@ -182,3 +182,3 @@ # PostCSS Custom Properties [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss] | ||
[cli-img]: https://img.shields.io/travis/postcss/postcss-custom-properties.svg | ||
[cli-img]: https://img.shields.io/travis/postcss/postcss-custom-properties/master.svg | ||
[cli-url]: https://travis-ci.org/postcss/postcss-custom-properties | ||
@@ -185,0 +185,0 @@ [css-img]: https://cssdb.org/badge/custom-properties.svg |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
107858
912
1