D
D
DON19862018-09-08 13:58:04
Sass
DON1986, 2018-09-08 13:58:04

Why doesn't gulp sass compile nested pseudo-classes and pseudo-elements?

gulpfile.js

var gulp 		 = require('gulp'),
    sass 		 = require('gulp-sass');
gulp.task('sass', function(){
  return gulp.src('app/sass/**/*.scss')
    .pipe(sass()) 
    .pipe(gulp.dest('app/css'))
    .pipe(browserSync.reload({stream: true}))
});

code in scss
.nav__item {
  color: #aaa;
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-right: 70px;

  $:hover {
  color: #111;
  }	
}

I get an answer
Error: app\sass\_nav.scss
Error: Invalid CSS after "...in-right: 70px;": expected "}", was "$:hover {"
        on line 29 of app/sass/_nav.scss
        from line 4 of app/sass/main.scss
>>      margin-right: 70px;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hellcaster, 2018-09-08
@DON1986

Not $:hover but &:hover
The $ sign is a variable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question