Skip to content

Commit

Permalink
Add test to ensure var() usage inside other CSS function doesn't mang…
Browse files Browse the repository at this point in the history
…le parenthesis
  • Loading branch information
MadLittleMods committed Nov 10, 2017
1 parent 6baa5ef commit dfb5ec1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions test/fixtures/nested-inside-other-func.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.box-foo {
background-color: color(var(--some-color, white));
}
3 changes: 3 additions & 0 deletions test/fixtures/nested-inside-other-func.expected.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.box-foo {
background-color: color(white);
}
3 changes: 1 addition & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ var test = function(message, fixtureName, options) {


describe('postcss-css-variables', function() {


// Just make sure it doesn't mangle anything
test('should work when there are no var() functions to consume declarations', 'no-var-func');
test('should work when there are no var() functions(just `:root`) to consume declarations', 'no-var-func-just-root');
Expand Down Expand Up @@ -207,6 +205,7 @@ describe('postcss-css-variables', function() {
test('should use fallback variable if provided with missing variables', 'missing-variable-should-fallback-var');
test('should use fallback variable if provided with missing variables calc', 'missing-variable-should-fallback-calc');
test('should use fallback variable if provided with missing variables nested', 'missing-variable-should-fallback-nested');
test('should not mangle outer function parentheses', 'nested-inside-other-func');
});

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

0 comments on commit dfb5ec1

Please sign in to comment.