Skip to content

Commit dfb5ec1

Browse files
committed
Add test to ensure var() usage inside other CSS function doesn't mangle parenthesis
1 parent 6baa5ef commit dfb5ec1

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.box-foo {
2+
background-color: color(var(--some-color, white));
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.box-foo {
2+
background-color: color(white);
3+
}

test/test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ var test = function(message, fixtureName, options) {
5757

5858

5959
describe('postcss-css-variables', function() {
60-
61-
6260
// Just make sure it doesn't mangle anything
6361
test('should work when there are no var() functions to consume declarations', 'no-var-func');
6462
test('should work when there are no var() functions(just `:root`) to consume declarations', 'no-var-func-just-root');
@@ -207,6 +205,7 @@ describe('postcss-css-variables', function() {
207205
test('should use fallback variable if provided with missing variables', 'missing-variable-should-fallback-var');
208206
test('should use fallback variable if provided with missing variables calc', 'missing-variable-should-fallback-calc');
209207
test('should use fallback variable if provided with missing variables nested', 'missing-variable-should-fallback-nested');
208+
test('should not mangle outer function parentheses', 'nested-inside-other-func');
210209
});
211210

212211
it('should not parse malformed var() declarations', function() {

0 commit comments

Comments
 (0)