Skip to content

Commit 07010de

Browse files
committed
Add parser check
1 parent 536a65d commit 07010de

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/language-css/parser-postcss.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ function parseNestedCSS(node, options) {
382382

383383
if (node.type === "css-atrule") {
384384
// mixin
385-
if (node.mixin) {
385+
if (options.parser !== "scss" && node.mixin) {
386386
const source =
387387
node.raws.identifier +
388388
node.name +
@@ -394,12 +394,12 @@ function parseNestedCSS(node, options) {
394394
}
395395

396396
// function
397-
if (node.function) {
397+
if (options.parser !== "scss" && node.function) {
398398
return node;
399399
}
400400

401401
// only css support custom-selector
402-
if (node.name === "custom-selector" && options.parser === "css") {
402+
if (options.parser === "css" && node.name === "custom-selector") {
403403
const customSelector = node.params.match(/:--\S+?\s+/)[0].trim();
404404
node.customSelector = customSelector;
405405
node.selector = parseSelector(
@@ -428,7 +428,7 @@ function parseNestedCSS(node, options) {
428428
}
429429

430430
// Less variable
431-
if (node.variable) {
431+
if (options.parser !== "scss" && node.variable) {
432432
delete node.params;
433433
return node;
434434
}

0 commit comments

Comments
 (0)