Skip to content

Commit de4356b

Browse files
evilebottnawimichael-ciniawsky
authored andcommitted
fix: case insensitivity of @import (#514)
1 parent 67cae9a commit de4356b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/processCss.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var parserPlugin = postcss.plugin("css-loader-parser", function(options) {
4141
}
4242

4343
if(options.import) {
44-
css.walkAtRules("import", function(rule) {
44+
css.walkAtRules(/import/i, function(rule) {
4545
var values = Tokenizer.parseValues(rule.params);
4646
var url = values.nodes[0].nodes[0];
4747
if(url.type === "url") {

test/importTest.js

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ describe("import", function() {
99
], "", {
1010
"./test.css": [[2, ".test{a: b}", ""]]
1111
});
12+
test("import camelcase", "@IMPORT url(test.css);\n.class { a: b c d; }", [
13+
[2, ".test{a: b}", ""],
14+
[1, ".class { a: b c d; }", ""]
15+
], "", {
16+
"./test.css": [[2, ".test{a: b}", ""]]
17+
});
1218
test("import with string", "@import \"test.css\";\n.class { a: b c d; }", [
1319
[2, ".test{a: b}", ""],
1420
[1, ".class { a: b c d; }", ""]

0 commit comments

Comments
 (0)