vendredi 24 juin 2016

Django maintaining app specific css in gulp-minify main.css


I am setting up a new development environment that will allow for a single website with multiple apps. I have chosen to use django and setup has proceeded smoothly. I have created a gulpfile that will minify my scss and uglify my js as well as a few other items.

The issue that I have encountered is if each app I create has it's own css file how can I maintain the relationship of that css code to that app inside the now minify css created by my gulp task?

I can see using namespace to help maintain the relationships but what I wish to avoid is having app1 and app2 having a conflict on an <h2> for example. Or having app1 now dictating how all <h2> are going to render. Is there a way to setup the css or scss to maintain application specific css?

Gulpfile task that minifys

gulp.task('sass', function() {
return gulp.src('static/scss/*.scss')
    .pipe(sass())
    .pipe(gulp.dest('static/stylesheets'))
    .pipe(rename({suffix: '.min'}))
    .pipe(minifycss())
    .pipe(gulp.dest('static/stylesheets'))
    .pipe(gzip(gzip_options))
    .pipe(gulp.dest('static/stylesheets'))
    .pipe(browserSync.stream());
});

Aucun commentaire:

Enregistrer un commentaire