Programster's Blog

Tutorials focusing on Linux, programming, and open-source

PhpStorm - Configure SCSS Compilation

I like to make use of Sass scss files that transpile to native CSS. I do not make use of any kind of NPM build tool, so I find it convenient to just have my IDE compile the files to CSS whenever I save. This tutorial will show you how to do this.

Steps

Press Ctrl + Alt + S in order to bring up the settings menu, before then navigating to Tools > File Watchers and click on the + symbol to add a new file watcher.


Click on SCSS from the dropdown menu. If you want to compile something like Less or Sass files, then select them instead.


Now fill in the arguments as appropriate. For me, I keep my scss files in a sibling folder to the CSS folder, so I set the Arguments field to:

$FileName$:$FileParentDir$/css/$FileNameWithoutExtension$.css


You should now see that the SCSS file watcher has been created and enabled.

Last updated: 25th January 2022
First published: 25th January 2022

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch