NetBeans – bbird.me http://bbird.me WordPress quick tips Wed, 08 Aug 2018 16:39:07 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.8 Auto compile Sass on save in NetBeans http://bbird.me/auto-compile-sass-on-save-in-netbeans/ http://bbird.me/auto-compile-sass-on-save-in-netbeans/#respond Sat, 12 Sep 2015 09:24:48 +0000 http://bbird.me/?p=245 If you’re developing WordPress websites in NetBeans, there is a chance that you will edit CSS using the Sass approach. In

Post Auto compile Sass on save in NetBeans je prvi puta viđen na bbird.me.

]]>
If you’re developing WordPress websites in NetBeans, there is a chance that you will edit CSS using the Sass approach. In other words, for every change you make in any of the Sass partials, you will surely want these changes compile into main style.css file automatically. NetBeans offers you this option. And the best of all, it’s very easy to set this up, but you may Google that many developers are having trouble doing it the right way.

I am assuming that you have NetBeans installed and WordPress project created. The steps are as follows:

Download the latest Ruby from http://rubyinstaller.org/downloads/ and install. When installing, make sure you thick the middle option:

ruby

The next step is to install Sass from command promptopen command prompt and type the following:

gem install sass

Upon successful installation, several new files appeared in your Ruby folder – one of them is sass.bat you will need.

Now open NetBeans, open Tools -> Options and point to Miscellaneous. This is where you will select your Sass processor. If you installed Ruby in default path, you will have something like this:

sass1

Restart NetBeans after that (some users reportedly had to do it, so just in case 🙂 ).

Completing these steps doesn’t mean that your Sass files will be processed – this is where most tutorials finish, forgetting the most important thing – setting the Sass file path! This is how you do it:

  1. Right click on the project name and click properties.
  2. Now, refer to the next image that will give you an idea on how to set input as output paths for Sass preprocessor. In my case, WordPress root directory is the projects’ root directory, hence the path I added.

sass2

And there you go – make a change in any of the partials or the main file, and providing there are no errors (undeclared variables, etc), Netbeans will compile main CSS file.

Post Auto compile Sass on save in NetBeans je prvi puta viđen na bbird.me.

]]>
http://bbird.me/auto-compile-sass-on-save-in-netbeans/feed/ 0