Yep, sass in my gulpfile ([email protected]) reports many errors (and keeps continuing the watch, just as it should...), but not errors like these:
=clearfix()
&:after
content: ""
display: table
clear both
content
and display
make it correctly into the actual class (where the mixin is referenced), but clear
doesn't (because I missed the colon). This is a syntax error (so it's not like rareproperty: 42px;
handled gracefully). → still: No errors seen, no interruption.
My gulp task:
gulp.task('sass', function() {
return gulp.src(src.scssMaster)
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe( sass({
debugInfo : true,
lineNumbers : true,
outputStyle: 'expanded'
})
.on('error', function(err){
gutil.log(err); // stackoverflow.com/a/30742014/444255
this.emit('end');
})
)
.pipe(autoprefixer({
browsers: ['iOS >= 5', 'ie 8', 'Firefox > 2'],
cascade: true,
remove: true
}))
.pipe(rename('lznet.css'))
.pipe(sourcemaps.write('../maps'))
.pipe(gulp.dest(src.cssDir))
.pipe(reload({stream: true}))
.on('end', () => gutil.log('sass thing done'));
});
Mille grazie ❤
It's not a syntax error at all. Take this example:
This compiles to the following CSS:
It certainly looks like the error of the wrongly specified
clear both
property is silently ignored. What is actually happening is that you have defined a nested.foo clear both
selector. But since your.foo clear both
selector is empty it is optimized away by the SASS compiler.This becomes clear when you look at what happens with another SASS example:
This compiles to the following CSS:
Now the
.foo clear both
selector isn't empty and the CSS is no longer optimized away by the compiler.SASS doesn't know or care about the fact that there isn't actually a
clear
orboth
element in any of the HTML specifications. This is a feature and not a bug since:clear
andboth
wouldn't be valid names even for web components).clear
orboth
.