You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Long ago, Sass stopped taking compound @extends. It said an error message to the effect of "please use .selector-1, :pseudo-class". I didn't read the details, and I just obeyed. The code still worked, and I didn't bother to check, but that had the effect of producing monster selectors. For instance, extending ::before would extend every::before in the code base.
It produced huge CSS files, but it worked. Recently, however, the result of my wrong @extend has just been... infinite compilation, a fast spinning fan, and the need to force-quit CodeKit.
I know my code is wrong, and I've refactored it in newer projects. But I wish these cases were handled better. An error message or something, instead of just infinitely looping on my extends. Because I'll need to fix older projects moving forward.
It would be nice if the compiler helped with error messages instead of just dying on me.
Would that be doable?
some-file.scss
.icon-arrow-right:before {
content: "\e90a";
}
.some-random-element-with-before {
&::before {
content: '';
// other styles
}
}
.some-element {
@extend.icon-arrow-right, :before;
}
// Repeat this sort of thing several times in the code base
Actual results
[Infinite compiling... CodeKit needs to be force-quit]
Expected result
[ERROR!] You probably @extended wrong, because
this is the 100th time we've extended "::before".
Compiling stopped at line X of file Y.
---OR---
[WARNING] Compiled successfully, but we produced the following gargantuan selector. Maybe fix your stuff?
Selector originates at line X of file Y.
version info:
codekit 3.11
node-sass N/A (Wrapper) [JavaScript] (I think CodeKit doesn't use this)
libsass 3.6.3 (Sass Compiler) [C/C++]
The text was updated successfully, but these errors were encountered:
Long ago, Sass stopped taking compound
@extend
s. It said an error message to the effect of "please use .selector-1, :pseudo-class". I didn't read the details, and I just obeyed. The code still worked, and I didn't bother to check, but that had the effect of producing monster selectors. For instance, extending::before
would extend every::before
in the code base.It produced huge CSS files, but it worked. Recently, however, the result of my wrong
@extend
has just been... infinite compilation, a fast spinning fan, and the need to force-quit CodeKit.I know my code is wrong, and I've refactored it in newer projects. But I wish these cases were handled better. An error message or something, instead of just infinitely looping on my extends. Because I'll need to fix older projects moving forward.
It would be nice if the compiler helped with error messages instead of just dying on me.
Would that be doable?
some-file.scss
Actual results
Expected result
---OR---
[WARNING] Compiled successfully, but we produced the following gargantuan selector. Maybe fix your stuff? Selector originates at line X of file Y.
version info:
The text was updated successfully, but these errors were encountered: