Skip to content

Commit

Permalink
fix(postcss-merge-longhand): mergeLonghand should not apply to CSS va…
Browse files Browse the repository at this point in the history
…riables (#1057)

Fixes #1051
  • Loading branch information
KKoukiou committed Apr 26, 2021
1 parent 15da338 commit 8aa64c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/postcss-merge-longhand/src/__tests__/borders.js
Expand Up @@ -1196,6 +1196,13 @@ test(
)
);

test(
'Should preserve border rule with only custom properties #1051',
passthroughCSS(
'h1{border-color: var(--a) var(--b) var(--c) var(--d);border-style:solid;border:var(--fooBar));}'
)
);

test(
'should overwrite some border-width props and save fallbacks and preserve case #648 2',
processCSS(
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-merge-longhand/src/lib/decl/borders.js
Expand Up @@ -55,7 +55,7 @@ function getLevel(prop) {
const isValueCustomProp = (value) => value && !!~value.search(/var\s*\(\s*--/i);

function canMergeValues(values) {
return !values.some(isValueCustomProp) || values.every(isValueCustomProp);
return !values.some(isValueCustomProp);
}

function getColorValue(decl) {
Expand Down

0 comments on commit 8aa64c7

Please sign in to comment.