LESS Compiler on macOS for PhpStom

How to setup less compiler on you macOS and make css file automatically. The solution for those developers, who don’t want to use Gulp.

Installing

  1. Install brew
    How to install Homebrew https://brew.sh/
  2. Install node
    brew install node
  3. install less compiler
    npm -g install less
  4. Creating a file watcher
    Preferences -> Tools -> File Watchers
    Click + and choose Less
  5. Setup settings
    Program: /usr/local/bin/lessc
    Arguments: --no-color $FileName$
    Output paths to refresh: $FileNameWithoutExtension$.css
    Working directory: $FileDir$

Config for your theme

This will enough for you work. But usually, you have few .less files and one style.css file. For this situation you need next parameters:

Program: /usr/local/bin/lessc
Arguments: $ProjectFileDir$/assets/less/style.less
Output paths to refresh: style.css
Working directory: $FileDir$

Related links