Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(postcss-merge-longhand): mergeLonghand should not apply to CSS variables #1057

Merged
merged 1 commit into from Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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