Print sub-nodes of @import in Less (#2646)

Fixes part of #2584.
This commit is contained in:
Simon Lydell authored and Christopher Chedeau committed 2017-08-21 12:28:22 -07:00
1 parent 23e0e90779
commit 3e924474cd
3 files changed
+33 -1

No files matched your search

+10 -1
View File
@@ -129,7 +129,16 @@ function genericPrint(path, options, print) {
" ",
n.directives ? concat([n.directives, " "]) : "",
adjustStrings(n.importPath, options),
";"
n.nodes.length > 0
? concat([
" {",
indent(
concat([softline, printNodeSequence(path, options, print)])
),
softline,
"}"
])
: ";"
]);
}
// postcss-media-query-parser
@@ -7,6 +7,23 @@ exports[`directives.css 1`] = `
`;
exports[`nodes.css 1`] = `
@import "test.less" {}
@import "test.less" {
a: b;
c: d;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@import "test.less";
@import "test.less" {
a: b;
c: d;
}
`;
exports[`url.css 1`] = `
@import url('foo');
$dir: 'fonts';
+6
View File
@@ -0,0 +1,6 @@
@import "test.less" {}
@import "test.less" {
a: b;
c: d;
}