Skip to content

Commit b1702d4

Browse files
pixeldrewMadLittleMods
authored andcommitted
Log undefined variables (MadLittleMods#69)
Fix MadLittleMods#31
1 parent dfb5ec1 commit b1702d4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) {
234234
ruleToWorkOn.nodes.slice(0).forEach(function(node) {
235235
if(node.type === 'decl') {
236236
var decl = node;
237-
resolveDecl(decl, map, opts.preserve);
237+
resolveDecl(decl, map, opts.preserve, logResolveValueResult);
238238
}
239239
});
240240
});

test/test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ describe('postcss-css-variables', function() {
199199
var colorDecl = fooRule.nodes[0];
200200
expect(colorDecl.value).to.be.a('string');
201201
expect(colorDecl.value).to.be.equal('undefined');
202+
203+
expect(result.warnings()[0].type).to.be.equal('warning');
204+
expect(result.warnings()[0].text).to.be.equal('variable --missing is undefined and used without a fallback');
202205
});
203206
});
204207
});

0 commit comments

Comments
 (0)