diff --git a/src/ast.hpp b/src/ast.hpp index 13543f0ccf..0ae676dab2 100644 --- a/src/ast.hpp +++ b/src/ast.hpp @@ -683,6 +683,7 @@ namespace Sass { { statement_type(COMMENT); } virtual bool is_invisible() const { return /* is_important() == */ false; } + bool is_hoistable() { return true; } ATTACH_OPERATIONS() }; diff --git a/src/output.cpp b/src/output.cpp index a369746390..1b5a410068 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -240,19 +240,16 @@ namespace Sass { append_token("@supports", f); append_mandatory_space(); c->perform(this); - append_scope_opener(); if (b->has_non_hoistable()) { - // JMA - hoisted, output the non-hoistable in a nested block, followed by the hoistable append_scope_opener(); - + // JMA - hoisted, output the non-hoistable in a nested block, followed by the hoistable for (size_t i = 0, L = b->length(); i < L; ++i) { Statement* stm = (*b)[i]; if (!stm->is_hoistable()) { stm->perform(this); } } - append_scope_closer(); for (size_t i = 0, L = b->length(); i < L; ++i) { @@ -263,18 +260,18 @@ namespace Sass { } } else { + append_scope_opener(); // JMA - not hoisted, just output in order for (size_t i = 0, L = b->length(); i < L; ++i) { Statement* stm = (*b)[i]; stm->perform(this); if (i < L - 1) append_special_linefeed(); } + append_scope_closer(); } if (output_style() == NESTED) indentation -= f->tabs(); - append_scope_closer(); - } void Output::operator()(Media_Block* m)