-
Install node.js,python(2 version),Microsoft Visual Studio C++ 2013 and gulp globally
npm install gulp -g
-
Install npm packages. If you have problems in browser-sync install on Windows look here
npm i
If you use link of global packages:
npm install gulp rimraf gulp-pug gulp-sass gulp-inline-image gulp-autoprefixer gulp-plumber gulp-directory-sync browser-sync gulp-concat gulp-cssfont64 gulp-html5-lint gulp-purifycss gulp-uglify gulp-imagemin imagemin-pngquant gulp-csso gulp-sourcemaps gulp-postcss postcss-assets postcss-reporter stylelint postcss-scss -g npm link gulp rimraf gulp-pug gulp-sass gulp-inline-image gulp-autoprefixer gulp-plumber gulp-directory-sync browser-sync gulp-concat gulp-cssfont64 gulp-html5-lint gulp-purifycss gulp-uglify gulp-imagemin imagemin-pngquant gulp-csso gulp-sourcemaps gulp-postcss postcss-assets postcss-reporter stylelint postcss-scss
-
Let's code!
gulp
-
Edit files in assets folder, see result in dist folder. If you want to build optimized version of project run :
gulp build
-
Command for html validation
gulp validation
-
Lint your styles
gulp cssLint
Create all your main scripts in assets/js. Create all your additional scripts (jquery,plugins, и т.д) in assets/js/all. Gulp will concat all your additional scripts into all.js
-
Install packages
npm install gulp-iconfont@4.0.0 gulp-iconfont-css -D
-
Put your icons to icons folder
-
Change variable 'fontName' in gulpfile.js ('iconfont' by default).
-
Uncomment iconfont task and run
gulp iconfont
-
Pic your font in fonts/icons and font extends(%placeholders) in icons.scss
-
Edit your font iconmoon
-
Install packages
npm install gulp-svg-sprite gulp-svgmin gulp-cheerio gulp-replace -g npm link gulp-svg-sprite gulp-svgmin gulp-cheerio gulp-replace
-
Put your icons into icons folder
-
Uncomment task svgSpriteBuild
-
Run task svgSpriteBuild
-
Now you have sprite.svg in assets/i/sprite folder. By default you have svg4everybody script in your js. Also you have scss file _sprite.scss for styling sprite.
-
Run svg4everybody in your main.js file. For including icons use jade mixin "icon"
$(document).ready(function () {
svg4everybody({});
});
.test_block {
width: width('rub.png');
height: height('rub.png');
background: resolve('rub.png') no-repeat;
background-size: size('rub.png');
}