Skip to content

Commit

Permalink
Merge pull request sass#3002 from mgreter/bugfix/2998-extend-compound…
Browse files Browse the repository at this point in the history
…-warning

Fix compound extend warning
  • Loading branch information
mgreter committed Oct 23, 2019
2 parents 4da7c4b + 16365c1 commit e116b49
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/expand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,18 @@ namespace Sass {

if (compound->length() != 1) {

std::cerr <<
"compound selectors may no longer be extended.\n"
"Consider `@extend ${compound.components.join(', ')}` instead.\n"
"See http://bit.ly/ExtendCompound for details.\n";
std::stringstream sels; bool addComma = false;
sels << "Compound selectors may no longer be extended.\n";
sels << "Consider `@extend ";
for (auto sel : compound->elements()) {
if (addComma) sels << ", ";
sels << sel->to_sass();
addComma = true;
}
sels << "` instead.\n";
sels << "See http://bit.ly/ExtendCompound for details.";

warning(sels.str(), compound->pstate());

// Make this an error once deprecation is over
for (SimpleSelectorObj simple : compound->elements()) {
Expand Down

0 comments on commit e116b49

Please sign in to comment.