Skip to content

Commit 6e0cb0d

Browse files
committed
Add skipMultiColor option. #6
1 parent 32f2064 commit 6e0cb0d

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 0.2.2 - 2016-01-13
2+
3+
- Add `skipMultiColor` option.
4+
15
### 0.2.1 - 2015-12-21
26

37
- Add supports for `rad, grad, turn` unit.

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,18 @@ Default: `true`
4444
IE filter doesn't support angular gradient. By default, when processing the angular gradient,
4545
we will convert the angle to its closest direction. You can disable this feature by setting this option to `false`.
4646

47+
### skipMultiColor
48+
49+
Default: `false`
50+
51+
If set to `true`, we will not handle the rules which have multi color stops. It is useful when you want use a
52+
background color as fallback.
53+
4754
## Limitation
4855

4956
The IE filter gradient only support horizontal and vertical directions, and only support two colors. So, if there are more
50-
than two colors in the color stops, we only pick the first and the last one.
57+
than two colors in the color stops, we only pick the first and the last one. You can skip it by setting
58+
`option.skipMultiColor` to `true`.
5159

5260
## FAQ
5361

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
a {
2+
background: linear-gradient(rgb(30, 87, 153) 0%, rgb(125, 185, 232) 76%, rgb(96, 178, 130) 100%);
3+
}
4+
5+
b {
6+
background: linear-gradient(to bottom, blue, green, red);
7+
}
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
a {
2+
background: linear-gradient(rgb(30, 87, 153) 0%, rgb(125, 185, 232) 76%, rgb(96, 178, 130) 100%);
3+
}
4+
5+
b {
6+
background: linear-gradient(to bottom, blue, green, red);
7+
}
8+

test/test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ describe('postcss-filter-gradient', function () {
106106
}
107107
);
108108

109+
it('shouldnt handle multi colorstops when `option.skipMultiColor` is true',
110+
function (done) {
111+
test('option-skip-multicolor', { skipMultiColor: true }, done);
112+
}
113+
);
114+
109115
it('should handle the `grad` unit correctly', function (done) {
110116
test('grad', {}, done);
111117
});

0 commit comments

Comments
 (0)