Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. "use strict";
  2. var gulp = require('gulp'),
  3. autoprefixer = require('gulp-autoprefixer'),
  4. browserSync = require('browser-sync'),
  5. // concat = require('gulp-concat'),
  6. //concatCss = require('gulp-concat-css'),
  7. //connect = require('gulp-connect'),
  8. gcmq = require('gulp-group-css-media-queries'),
  9. less = require('gulp-less'),
  10. //less2sass = require('gulp-less2sass'),
  11. minifyCSS = require('gulp-minify-css'),
  12. //notify = require('gulp-notify'),
  13. rename = require('gulp-rename'),
  14. // sass = require('gulp-sass'),
  15. uncss = require('gulp-uncss'),
  16. /*START Smartrid*/
  17. smartgrid = require('smart-grid'),
  18. settings = {
  19. outputStyle: 'less',
  20. columns: 12,
  21. offset: "0px",
  22. container: {
  23. maxWidth: '100%', /* max-width ะพn very large screen */
  24. fields: '15%'
  25. },
  26. breakPoints: {
  27. lg: {
  28. 'width': '1100px',
  29. 'fields': '10%'
  30. },
  31. md: {
  32. 'width': '960px',
  33. 'fields': '5%'
  34. },
  35. m: {
  36. 'width': '780px',
  37. 'fields': '3.5%'
  38. },
  39. sm: {
  40. 'width': '560px',
  41. 'fields': '2%'
  42. },
  43. xs: {
  44. 'width': '320px',
  45. 'fields': '0'
  46. }
  47. }
  48. };
  49. /*END Smartgrid*/
  50.  
  51. // browser-sync
  52. gulp.task('browser-sync', function() {
  53. browserSync({
  54. server: {
  55. baseDir: 'app'
  56. },
  57. notify: false
  58. });
  59. });
  60.  
  61. //smartgrid
  62. gulp.task('smartgrid', function() {
  63. smartgrid('app/preprocessor/',settings)
  64. });
  65.  
  66. //preprocessing to css
  67. gulp.task('css', function() {
  68. return gulp.src('app/preprocessor/styles.less')
  69. .pipe(less())
  70. //.pipe(less2sass())
  71. //.pipe(gulp.dest('app/sass'))
  72. //.pipe(sass())
  73. //.pipe(concat('../css/includes/*.css'))*/
  74. //.pipe(autoprefixer({browsers: ['last 2 versions', 'safari 5', 'ie6', 'ie7', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'], cascade: false}))
  75. //.pipe(autoprefixer({browsers: ['>0.1%'], cascade: false}))
  76. //.pipe(autoprefixer({browsers: ['IE 9', 'IE 10', 'IE 11', 'Opera 12', 'iOS 7', 'last 5 versions'], cascade: false}))
  77. .pipe(autoprefixer({browsers: ['last 15 version'],cascade: false}))
  78. .pipe(gcmq())
  79. .pipe(gulp.dest('app/css'))
  80. //.pipe(uncss({html: ['app/index.html']})).pipe(minifyCSS()).pipe(rename('styles.min.css')).pipe(gulp.dest('dist/css'))
  81. .pipe(browserSync.reload({stream:true}))
  82. });
  83.  
  84. //watch
  85. gulp.task('watch', function() {
  86. //gulp.watch('app/sass/**/*.sass', ['css']);
  87. gulp.watch('app/preprocessor/**/*.less', ['css']);
  88. gulp.watch('app/*.html', browserSync.reload);
  89. gulp.watch('app/js/**/*.js', browserSync.reload);
  90. });
  91.  
  92. //default
  93. gulp.task('default', ['watch','browser-sync','smartgrid','css']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement