Answer the question
In order to leave comments, you need to log in
BrowserSync page jumps when updating CSS?
Kind. When updating the page through gulp + browserSync, the page jumps to the very top, although I edit the footer, this happens with CSS, and every other time, moreover, when this happens, the buttons on the site jump (they expand, as it were, and there is such a white flash, as if on a new page updated), googled, many have such a problem, but no one has written a solution .. (very inconvenient, you have to scroll to the very bottom ..
gulp.task('sass', function () {
return gulp.src('app/sass/*.scss')
.pipe(sass({
outputStyle: 'expanded',
indentType: 'tab',
indentWidth: 1
}).on('error', function (err) {
console.error(err.message);
browserSync.notify(err.message, 3000);
this.emit('end');
}))
.pipe(autoprefixer(['last 15 versions'], {
cascade: true
}))
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({
stream: true
}));
});
gulp.task('watch', ['browser-sync', 'css-libs', 'scripts'], function () {
gulp.watch('app/sass/*.scss', ['sass']);
gulp.watch('app/*.html', browserSync.reload);
gulp.watch('app/js/*.js', browserSync.reload);
});
Answer the question
In order to leave comments, you need to log in
If someone has a similar problem - the jump up was due to compiling media.scss, I don’t know why, but I deleted the file with media queries and everything became normal, moreover, there were no rules other than the usual template for different resolutions, but they were all empty .. in general, this was the case) well, nothing, I will write directly in media.css, scss is not really needed in media queries
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question