Skip to content

Commit

Permalink
fix: not convert currentColor (#559) (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjansson authored and evilebottnawi committed Jul 20, 2018
1 parent 28d89b0 commit 81f488d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/postcss-merge-longhand/src/__tests__/borders.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,9 @@ test(
passthroughCSS,
'h1{border-left-style:solid;border-left-color:#d3d6db;border:1px solid var(--gray-lighter);border-left-width:0;}',
);

test(
'Should not convert currentColor (#559)',
passthroughCSS,
'h1{border:2px solid transparent;border-top-color:currentColor;}',
);
2 changes: 1 addition & 1 deletion packages/postcss-merge-longhand/src/lib/decl/borders.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ function merge (rule) {
});

// clean-up values
rule.walkDecls(/^border($|-(top|right|bottom|left))/, decl => {
rule.walkDecls(/^border($|-(top|right|bottom|left)$)/, decl => {
const value = [...parseWsc(decl.value), ''].reduceRight((prev, cur, i, arr) => {
if (cur === defaults[i] && arr[i-1] !== cur) {
return prev;
Expand Down

0 comments on commit 81f488d

Please sign in to comment.