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

Commit

Permalink
Fix compound extend warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Oct 7, 2019
1 parent 4da7c4b commit 16365c1
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 16365c1

Please sign in to comment.