-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
53 lines (45 loc) · 1.38 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var deploy = require('gulp-gh-pages');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer-core');
var cssimport = require('postcss-import');
var customProperties = require('postcss-custom-properties');
var hwb = require('postcss-color-hwb');
var color = require('color');
var customMedia = require('postcss-custom-media');
var url = require('url');
gulp.task('styles', function () {
var processors = [
cssimport(),
hwb(),
customMedia(),
customProperties(),
autoprefixer({ browsers: ['last 2 versions'] })
];
return gulp.src(['css_src/main.css', 'css_src/frontpage-only.css'])
.pipe(postcss(processors))
.pipe(gulp.dest('css'));
});
// gulp.task('deploy', function () {
// return gulp.src(['www/**'])
// .pipe(deploy());
// });
gulp.task('default', function() {
browserSync({
server: {
baseDir: ['www'],
routes: {
'/css' : 'css',
'/svg' : 'svg'
}
}
});
gulp.watch(['www/**/*', 'css/*.css', 'svg/*.svg'], reload);
gulp.watch(['css_src/*'], ['styles']);
});
gulp.task('color', function() {
console.log(color('rgb(221, 25, 29)').hwb());
console.log(color('rgb(176, 18, 10)').hwb());
});