Skip to content

Commit

Permalink
use PostCSS 4.1 API
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Jun 13, 2015
1 parent 72cec98 commit 5682af2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
# 1.3.0 - 2015-06-13

- Changed: upgrade to PostCSS 4.1.x

# 1.2.0 - 2015-03-12

- Added: contrast() adjuster
Expand Down
5 changes: 3 additions & 2 deletions index.js
@@ -1,14 +1,15 @@
/**
* Module dependencies.
*/
var postcss = require("postcss")
var balanced = require("balanced-match")
var colorFn = require("css-color-function")
var helpers = require("postcss-message-helpers")

/**
* PostCSS plugin to transform color()
*/
module.exports = function plugin() {
module.exports = postcss.plugin("postcss-color-function", function() {
return function(style) {
style.eachDecl(function transformDecl(decl) {
if (!decl.value || decl.value.indexOf("color(") === -1) {
Expand All @@ -20,7 +21,7 @@ module.exports = function plugin() {
}, decl.source)
})
}
}
})

/**
* Transform color() to rgb()
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -5,7 +5,7 @@
"keywords": [
"css",
"postcss",
"postcss-plugins",
"postcss-plugin",
"color",
"colour",
"function"
Expand All @@ -24,12 +24,12 @@
"dependencies": {
"balanced-match": "^0.1.0",
"css-color-function": "^1.2.0",
"postcss": "^4.1.11",
"postcss-message-helpers": "^1.1.0"
},
"devDependencies": {
"jscs": "^1.6.2",
"jshint": "^2.5.6",
"postcss": "^4.0.2",
"tape": "^3.0.0"
},
"scripts": {
Expand Down

0 comments on commit 5682af2

Please sign in to comment.