Skip to content

Commit 18ab3f2

Browse files
committed
Update css-color-function to enable contrast()
1 parent abecafd commit 18ab3f2

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ color( [ <color> | <hue> ] <color-adjuster>* )
6767
- `shade( <percentage> )`
6868
- `blend( <color> <percentage> [rgb | hsl | hwb]? )`
6969
- ~~`blenda( <color> <percentage> [rgb | hsl | hwb]? )`~~ @todo
70-
- ~~`contrast( <percentage>? )`~~ @todo
70+
- `contrast( <percentage>? )`
7171

7272
Notes:
7373

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
"dependencies": {
2525
"balanced-match": "^0.1.0",
26-
"css-color-function": "^1.1.1",
26+
"css-color-function": "^1.2.0",
2727
"postcss-message-helpers": "^1.1.0"
2828
},
2929
"devDependencies": {

test/fixtures/color.css

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ body {
22
color: color(red);
33
background-color: color(red tint(50%));
44
border-color: color(hsla(125, 50%, 50%, .4) hue(200));
5+
border-top-color: color(hwb(270, 10%, 0%) contrast(50%));
56
}

test/fixtures/color.expected.css

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ body {
22
color: rgb(255, 0, 0);
33
background-color: rgb(255, 128, 128);
44
border-color: rgba(64, 149, 191, 0.4);
5+
border-top-color: rgb(248, 240, 255);
56
}

0 commit comments

Comments
 (0)