Skip to content

Commit 7b8a5e5

Browse files
committed
Merge pull request #10 from postcss/fix-plugin-api
use PostCSS 4.1 API
2 parents 72cec98 + 5682af2 commit 7b8a5e5

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.3.0 - 2015-06-13
2+
3+
- Changed: upgrade to PostCSS 4.1.x
4+
15
# 1.2.0 - 2015-03-12
26

37
- Added: contrast() adjuster

index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
/**
22
* Module dependencies.
33
*/
4+
var postcss = require("postcss")
45
var balanced = require("balanced-match")
56
var colorFn = require("css-color-function")
67
var helpers = require("postcss-message-helpers")
78

89
/**
910
* PostCSS plugin to transform color()
1011
*/
11-
module.exports = function plugin() {
12+
module.exports = postcss.plugin("postcss-color-function", function() {
1213
return function(style) {
1314
style.eachDecl(function transformDecl(decl) {
1415
if (!decl.value || decl.value.indexOf("color(") === -1) {
@@ -20,7 +21,7 @@ module.exports = function plugin() {
2021
}, decl.source)
2122
})
2223
}
23-
}
24+
})
2425

2526
/**
2627
* Transform color() to rgb()

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"keywords": [
66
"css",
77
"postcss",
8-
"postcss-plugins",
8+
"postcss-plugin",
99
"color",
1010
"colour",
1111
"function"
@@ -24,12 +24,12 @@
2424
"dependencies": {
2525
"balanced-match": "^0.1.0",
2626
"css-color-function": "^1.2.0",
27+
"postcss": "^4.1.11",
2728
"postcss-message-helpers": "^1.1.0"
2829
},
2930
"devDependencies": {
3031
"jscs": "^1.6.2",
3132
"jshint": "^2.5.6",
32-
"postcss": "^4.0.2",
3333
"tape": "^3.0.0"
3434
},
3535
"scripts": {

0 commit comments

Comments
 (0)