Skip to content

Commit

Permalink
Preserve indentation for media rules in nested mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Oct 29, 2019
1 parent 0790fc8 commit 5c267e1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/inspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ namespace Sass {
append_indentation();
append_token("@media", rule);
append_mandatory_space();
in_media_block = true;
in_media_block = false;
if (rule->block()) {
rule->block()->perform(this);
}
}

void Inspect::operator()(CssMediaRule* rule)
{
if (output_style() == NESTED)
indentation += rule->tabs();
append_indentation();
append_token("@media", rule);
append_mandatory_space();
Expand All @@ -97,6 +97,9 @@ namespace Sass {
if (rule->block()) {
rule->block()->perform(this);
}
in_media_block = false;
if (output_style() == NESTED)
indentation -= rule->tabs();
}

void Inspect::operator()(CssMediaQuery* query)
Expand Down Expand Up @@ -1056,7 +1059,7 @@ namespace Sass {
{
if (sel->hasPreLineFeed()) {
append_optional_linefeed();
if (output_style() == NESTED) {
if (!in_wrapped && output_style() == NESTED) {
append_indentation();
}
}
Expand Down

0 comments on commit 5c267e1

Please sign in to comment.