Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict";
- var gulp = require('gulp'),
- autoprefixer = require('gulp-autoprefixer'),
- browserSync = require('browser-sync'),
- // concat = require('gulp-concat'),
- //concatCss = require('gulp-concat-css'),
- //connect = require('gulp-connect'),
- gcmq = require('gulp-group-css-media-queries'),
- less = require('gulp-less'),
- //less2sass = require('gulp-less2sass'),
- minifyCSS = require('gulp-minify-css'),
- //notify = require('gulp-notify'),
- rename = require('gulp-rename'),
- // sass = require('gulp-sass'),
- uncss = require('gulp-uncss'),
- /*START Smartrid*/
- smartgrid = require('smart-grid'),
- settings = {
- outputStyle: 'less',
- columns: 12,
- offset: "0px",
- container: {
- maxWidth: '100%', /* max-width ะพn very large screen */
- fields: '15%'
- },
- breakPoints: {
- lg: {
- 'width': '1100px',
- 'fields': '10%'
- },
- md: {
- 'width': '960px',
- 'fields': '5%'
- },
- m: {
- 'width': '780px',
- 'fields': '3.5%'
- },
- sm: {
- 'width': '560px',
- 'fields': '2%'
- },
- xs: {
- 'width': '320px',
- 'fields': '0'
- }
- }
- };
- /*END Smartgrid*/
- // browser-sync
- gulp.task('browser-sync', function() {
- browserSync({
- server: {
- baseDir: 'app'
- },
- notify: false
- });
- });
- //smartgrid
- gulp.task('smartgrid', function() {
- smartgrid('app/preprocessor/',settings)
- });
- //preprocessing to css
- gulp.task('css', function() {
- return gulp.src('app/preprocessor/styles.less')
- .pipe(less())
- //.pipe(less2sass())
- //.pipe(gulp.dest('app/sass'))
- //.pipe(sass())
- //.pipe(concat('../css/includes/*.css'))*/
- //.pipe(autoprefixer({browsers: ['last 2 versions', 'safari 5', 'ie6', 'ie7', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'], cascade: false}))
- //.pipe(autoprefixer({browsers: ['>0.1%'], cascade: false}))
- //.pipe(autoprefixer({browsers: ['IE 9', 'IE 10', 'IE 11', 'Opera 12', 'iOS 7', 'last 5 versions'], cascade: false}))
- .pipe(autoprefixer({browsers: ['last 15 version'],cascade: false}))
- .pipe(gcmq())
- .pipe(gulp.dest('app/css'))
- //.pipe(uncss({html: ['app/index.html']})).pipe(minifyCSS()).pipe(rename('styles.min.css')).pipe(gulp.dest('dist/css'))
- .pipe(browserSync.reload({stream:true}))
- });
- //watch
- gulp.task('watch', function() {
- //gulp.watch('app/sass/**/*.sass', ['css']);
- gulp.watch('app/preprocessor/**/*.less', ['css']);
- gulp.watch('app/*.html', browserSync.reload);
- gulp.watch('app/js/**/*.js', browserSync.reload);
- });
- //default
- gulp.task('default', ['watch','browser-sync','smartgrid','css']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement