Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3021 from mgreter/bugfix/3018-nested-sel-nl-ws
Browse files Browse the repository at this point in the history
Fix some nested mode indentation
  • Loading branch information
mgreter authored Nov 2, 2019
2 parents a089875 + 5c267e1 commit 081bbbf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 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,6 +1059,9 @@ namespace Sass {
{
if (sel->hasPreLineFeed()) {
append_optional_linefeed();
if (!in_wrapped && output_style() == NESTED) {
append_indentation();
}
}
const SelectorComponent* prev = nullptr;
for (auto& item : sel->elements()) {
Expand Down

0 comments on commit 081bbbf

Please sign in to comment.