Skip to content

Commit

Permalink
fix(postcss-ordered-values): preserve constant values (#1411)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlee2k committed Jun 1, 2022
1 parent ffa084e commit 32ab4d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/postcss-ordered-values/src/index.js
Expand Up @@ -72,7 +72,7 @@ function isVariableFunctionNode(node) {
return false;
}

return ['var', 'env'].includes(node.value.toLowerCase());
return ['var', 'env', 'constant'].includes(node.value.toLowerCase());
}

/**
Expand Down
10 changes: 10 additions & 0 deletions packages/postcss-ordered-values/test/index.js
Expand Up @@ -580,6 +580,16 @@ test(
passthroughCSS('border-bottom:ENV(safe-area-inset-bottom) solid transparent')
);

test(
'should abort ordering when a constant is detected (border)',
passthroughCSS('border-bottom:constant(safe-area-inset-bottom) solid transparent')
);

test(
'should abort ordering when a constant is detected (border) (uppercase)',
passthroughCSS('border-bottom:CONSTANT(safe-area-inset-bottom) solid transparent')
);

test('should use the postcss plugin api', usePostCSSPlugin(plugin()));

test(
Expand Down

0 comments on commit 32ab4d9

Please sign in to comment.