Skip to content

Commit

Permalink
Fix for 2991
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Nicodemi committed Sep 24, 2021
1 parent e491ff6 commit f074cbe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/less/src/less/visitors/to-css-visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class CSSVisitorUtils {
? (rulesetNode.paths.length > 0) : false;
}

resolveVisibility(node, originalRules) {
resolveVisibility(node) {
if (!node.blocksVisibility()) {
if (this.isEmpty(node) && !this.containsSilentNonBlockedChild(originalRules)) {
if (this.isEmpty(node)) {
return ;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
.referenced {
// line comment is enough to reproduce it
// This file should not output anything if referenced.
@media (hover) {
// sezam
// This file should not output anything if referenced.
}
// repeat to prove point
// This file should not output anything if referenced.
@media (hover) {
// sezam
// This file should not output anything if referenced.
}
// but block comment is not, huh
// This file should not output anything if referenced.
@media (hover) {
/* salabim */
/* This file should not output anything if referenced. */
}
// following block does not output, needs line comment
// This file should not output anything if referenced.
@media (hover) {
color: #000000;
}
}
// needs to be nested to fail
// This file should not output anything if referenced.
@media (hover) {
// sezam
// This file should not output anything if referenced.
}
@media (hover) {
/* This file should not output anything if referenced. */
}

0 comments on commit f074cbe

Please sign in to comment.