Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Commit

Permalink
5.0.0 (switch to postcss 5.x)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Aug 25, 2015
1 parent ae55769 commit 136250a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
21 changes: 14 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
ecmaFeatures:
modules: true
root: true
extends: eslint:recommended

#ecmaFeatures:
# modules: true

env:
es6: true
# es6: true
browser: true
node: true

Expand All @@ -17,16 +20,20 @@ rules:
brace-style: [2, "stroustrup"]
comma-dangle: [2, "always-multiline"]
comma-style: [2, "last"]
computed-property-spacing: [2, "never"]
dot-location: [2, "property"]

one-var: [2, "never"]
# no-var: [2]
# prefer-const: [2]
no-bitwise: [2]

object-shorthand: [2, "methods"]
object-curly-spacing: [2, "never"]
array-bracket-spacing: [2, "never"]
computed-property-spacing: [2, "never"]

space-unary-ops: [2, {"words": true, "nonwords": false}]
space-after-keywords: [2, "always"]
space-before-blocks: [2, "always"]
space-before-function-paren: [2, "never"]
space-in-brackets: [2, "never"]
space-in-parens: [2, "never"]
spaced-line-comment: [2, "always"]
spaced-comment: [2, "always"]
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 5.0.0 - 2015-08-25

- Removed: compatibility with postcss v4.x
- Added: compatibility with postcss v5.x

# 4.2.0 - 2015-07-21

- Added: `warnings` option allows you to disable warnings.
Expand Down
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ module.exports = postcss.plugin("postcss-custom-properties", function(options) {
var importantMap = {}

// define variables
style.eachRule(function(rule) {
style.walkRules(function(rule) {
var toRemove = []

// only variables declared for `:root` are supported for now
Expand Down Expand Up @@ -216,7 +216,7 @@ module.exports = postcss.plugin("postcss-custom-properties", function(options) {

// remove empty :root {}
if (rule.nodes.length === 0) {
rule.removeSelf()
rule.remove()
}
}
})
Expand All @@ -242,7 +242,7 @@ module.exports = postcss.plugin("postcss-custom-properties", function(options) {
}

// resolve variables
style.eachDecl(function(decl) {
style.walkDecls(function(decl) {
var value = decl.value

// skip values that don’t contain variable functions
Expand All @@ -260,7 +260,7 @@ module.exports = postcss.plugin("postcss-custom-properties", function(options) {
})

if (!preserve || preserve === "computed") {
decl.removeSelf()
decl.remove()
}
})

Expand All @@ -269,7 +269,7 @@ module.exports = postcss.plugin("postcss-custom-properties", function(options) {
if (names.length) {
var container = postcss.rule({
selector: ":root",
semicolon: true,
raws: {semicolon: true},
})
names.forEach(function(name) {
var variable = map[name]
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-custom-properties",
"version": "4.2.0",
"version": "5.0.0",
"description": "PostCSS plugin to polyfill W3C CSS Custom Properties for cascading variables",
"keywords": [
"css",
Expand All @@ -17,16 +17,14 @@
"url": "https://github.com/postcss/postcss-custom-properties.git"
},
"files": [
"CHANGELOG.md",
"LICENSE",
"index.js"
],
"dependencies": {
"balanced-match": "~0.1.0",
"postcss": "^4.1.4"
"postcss": "^5.0.0"
},
"devDependencies": {
"eslint": "^0.23.0",
"eslint": "^1.0.0",
"tape": "^4.0.0"
},
"scripts": {
Expand Down

0 comments on commit 136250a

Please sign in to comment.