Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foundation sass gulp browsersync - @import foundation save file twice after browsersync reloading #71

Open
agencealbum opened this issue Nov 30, 2016 · 0 comments

Comments

@agencealbum
Copy link

agencealbum commented Nov 30, 2016

Hello,

When i use @import foundation in my scss i have need to save my scss file twice after browsersync reloading.
When i remove @import foundation in my scss it works perfectly.

Here my gulpfile.js

var gulp        = require('gulp');
var browserSync = require('browser-sync').create();
var compass = require('gulp-compass');
var svgmin = require('gulp-svgmin');

gulp.task('default', ['svgo'], function() {
	browserSync.init({
        proxy: "thermi.agencealbum.com",
        files: "/albumpress/",
        snippetOptions: {
	        rule: {
	            match: /$/
	        }
	    },
	    open: false
    });

    gulp.watch("img/*.svg", ['svgo']).on('change', browserSync.reload);
    gulp.watch("scss/*.scss", ['compass']).on('change', browserSync.reload);
});

//compass 
gulp.task('compass', function() {
	return gulp.src('scss/*.scss')
    	.pipe(compass({
	      css: 'css',
	      sass: 'scss',
	      import_path : 'node_modules/foundation-sites/scss/'
	    }))
    	.pipe(gulp.dest('css/'))
    	.pipe(browserSync.stream());
});

//svg optimisation 
gulp.task('svgo', function() {
    return gulp.src('img/*.svg')
        .pipe(svgmin({
        	plugins: [{
                removeStyleElement: true
            }]
        }))
        .pipe(gulp.dest('img/'))
        .pipe(browserSync.stream());
});

Here my scss

@import 'settings';
@import 'foundation';

body{
	background-color: blue;
}

Thanks for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants