- Make sure you have the latest
Node.js
LTS installed. Download - Open the command line and install
Gulp CLI
globally ones if not installed yet. Usenpm install gulp-cli -g
. cd
into your project folder in command line wherepackage.json
file located or open the folder in your explorer, right mouse click with pressedShift
key and chooseOpen command line here
.- Install all dependencies with
npm install
. - Change variable
path
if you need. For example, I use this path forOpenCart
:
const path = './catalog/view/theme/default/stylesheet/';
- Repeat steps 3, 4 and 5 in every project.
- For development run
gulp
in your project wheregulpfile.js
is located. It runs watch task and generates a newstyle.css
with sourcemaps whenever you change and save.scss
files.Autoprefixer
is disabled. - For production run
gulp build
in the command line. It removes sourcemaps, turns onautoprefixer
.
Also you can use your IDE panel. PHPStorm has a good one. Just double click the task name to run it or press
styles (or your path)
├── css
| ├─ style.css
| └─ style.css.map
└── scss
├─ helpers
├─ folder1
└─ folder2
main.scss
_variables.scss
_buttons.scss
@import 'variables.scss';
@import 'buttons.scss';