diff --git a/src/parser-postcss.js b/src/parser-postcss.js index c1a94f951..1c77f6347 100644 --- a/src/parser-postcss.js +++ b/src/parser-postcss.js @@ -209,7 +209,7 @@ function requireParser(isSCSS) { } function parse(text) { - const isLikelySCSS = !!text.match(/(\w\s*: [^}:]+|#){|\@import url/); + const isLikelySCSS = !!text.match(/(\w\s*: [^}:]+|#){|\@import[^\n]+(url|,)/); try { return parseWithParser(requireParser(isLikelySCSS), text); } catch (e) { diff --git a/tests/css_scss/__snapshots__/jsfmt.spec.js.snap b/tests/css_scss/__snapshots__/jsfmt.spec.js.snap index 1a11bc92c..e726f9ff0 100644 --- a/tests/css_scss/__snapshots__/jsfmt.spec.js.snap +++ b/tests/css_scss/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`import_comma.css 1`] = ` +@import "rounded-corners", "text-shadow"; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@import "rounded-corners", "text-shadow"; + +`; + exports[`scss.css 1`] = ` @media #{$g-breakpoint-tiny} {} .#{$fa-css-prefix}-glass:before { content: $fa-var-glass; } diff --git a/tests/css_scss/import_comma.css b/tests/css_scss/import_comma.css new file mode 100644 index 000000000..bea7a805e --- /dev/null +++ b/tests/css_scss/import_comma.css @@ -0,0 +1 @@ +@import "rounded-corners", "text-shadow";