Skip to content

Commit 5d6cf3a

Browse files
committed
Upgrade to PostCSS v5 - v0.5.0
1 parent 9043f26 commit 5d6cf3a

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
# v0.5.0 - 2015-9-12
3+
4+
- Upgrade to PostCSS v5. Fix #20
5+
26
# v0.4.0 - 2015-7-2
37

48
- Fix #15

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CSS variables or CSS Custom Properties limited subset polyfill/shim.
88

99
We strive for the most complete transformation but we/no plugin can achieve true complete parity according to the [specification](http://dev.w3.org/csswg/css-variables/) because of the DOM cascade unknowns.
1010

11-
## Latest Version: v0.4.0
11+
## Latest Version: v0.5.0
1212
### [Changelog](https://github.com/MadLittleMods/postcss-css-variables/blob/master/CHANGELOG.md)
1313

1414
### Install

index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// PostCSS CSS Variables (postcss-css-variables)
2-
// v0.4.0
2+
// v0.5.0
33
//
44
// https://github.com/MadLittleMods/postcss-css-variables
55

@@ -24,7 +24,7 @@ var RE_VAR_PROP = (/(--(.+))/);
2424

2525
function eachCssVariableDeclaration(css, cb) {
2626
// Loop through all of the declarations and grab the variables and put them in the map
27-
css.eachDecl(function(decl) {
27+
css.walkDecls(function(decl) {
2828
// If declaration is a variable
2929
if(RE_VAR_PROP.test(decl.prop)) {
3030
cb(decl);
@@ -42,7 +42,7 @@ function cleanUpNode(currentNodeToRemove) {
4242
// Get a reference to it before we remove and lose reference to the child after removing it
4343
currentNodeToPossiblyCleanUp = currentNodeToPossiblyCleanUp.parent;
4444

45-
nodeToRemove.removeSelf();
45+
nodeToRemove.remove();
4646
}
4747
}
4848

@@ -160,7 +160,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) {
160160

161161
// Remove the variable declaration because they are pretty much useless after we resolve them
162162
if(!opts.preserve) {
163-
decl.removeSelf();
163+
decl.remove();
164164
}
165165
// Or we can also just show the computed value used for that variable
166166
else if(opts.preserve === 'computed') {
@@ -186,7 +186,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) {
186186

187187
// Collect all the rules that have declarations that use variables
188188
var rulesThatHaveDeclarationsWithVariablesList = [];
189-
css.eachRule(function(rule) {
189+
css.walkRules(function(rule) {
190190
var doesRuleUseVariables = rule.nodes.some(function(node) {
191191
if(node.type === 'decl') {
192192
var decl = node;
@@ -218,7 +218,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) {
218218
return ruleClone;
219219
});
220220

221-
rule.removeSelf();
221+
rule.remove();
222222
}
223223

224224
// Resolve the declarations

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-css-variables",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"description": "PostCSS plugin to transform CSS Custom Properties(CSS variables) syntax into a static representation",
55
"keywords": [
66
"postcss",
@@ -16,7 +16,7 @@
1616
"dependencies": {
1717
"escape-string-regexp": "^1.0.3",
1818
"extend": "^2.0.1",
19-
"postcss": "^4.1.11"
19+
"postcss": "^5.0.5"
2020
},
2121
"devDependencies": {
2222
"bluebird": "^2.9.26",

0 commit comments

Comments
 (0)