Skip to content

Commit

Permalink
fix(postcss-minify-gradients): handle 2 color-stop-length in linear-g…
Browse files Browse the repository at this point in the history
…radient (#1215)

Co-authored-by: Rene <r.engel@boewa.de>
  • Loading branch information
goulashsoup and Rene committed Oct 29, 2021
1 parent a2cd55c commit 8bb7ba6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/postcss-minify-gradients/src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ test(
)
);

test(
'repeating-linear: should not remove necessary zero start length',
passthroughCSS(
'background:repeating-linear-gradient(-45deg,transparent 0 25%,#d1d3d5 25% 50%)'
)
);

test(
'linear: should not convert "to top right" to an angle',
passthroughCSS('background:linear-gradient(to top right,#ffe500,#121)')
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-minify-gradients/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function optimise(decl) {
let lastStop = null;

args.forEach((arg, index) => {
if (!arg[2]) {
if (arg.length !== 3) {
return;
}

Expand Down

0 comments on commit 8bb7ba6

Please sign in to comment.