
Sass preprocessor configuring on linux and windows, adding to editor
Writing CSS is fun in itself, but when the stylesheet gets huge it becomes difficult to maintain. And in this case, the preprocessor will help us. Sass allows you to use functions not available in CSS itself, for example, variables, nesting, mixins, inheritance and other nice things that return the convenience of writing CSS
Linux - Configuring the SASS preprocessor
1. Let's start first by installing ruby compass, in the command line we write:
sudo apt-get install ruby-compass
2. Next, using ruby, we get the gem package, with which we install sass:
gem install sass
3. For reference, see the path where sass is installed:
which sass
4. And for review, see the version that you installed:
sass -v
There is an example of how to use the sass preprocessor in the phpStorm editor
Registered in the settings like this:
- go to settings
- find the tools section, and go
- in tools we find the File watcher section, go there
- press the plus sign and select SASS
- we write the paths in it
Programm: /usr/local/bin/scss
Arguments: —no-cache —update $FileName$:$FileParentDir$/css/$FileNameWithoutExtension$.css
Output paths to refresh: $FileParentDir$/css/$FileNameWithoutExtension$.css
Windows - Setting up the SASS preprocessor
1. Download ruby from the site https://rubyinstaller.org/downloads/ and install
2. Agree with everything
3. Next, using ruby, we get the gem package, with which we install sass:
gem install sass
4. check in the sass command line, for this write sass and press enter
There is an example of how to use the sass preprocessor in the phpStorm editor
Registered in the settings like this:
- zahom in settings
- find the tools section, and go
- in tools we find the File watcher section, go there
- press the plus sign and select SASS
- we write the paths in it
Programm: sass
Arguments: $FileName$:$FileNameWithoutExtension$.css
Output paths to refresh: $FileNameWithoutExtension$.css:$FileNameWithoutExtension$.css.map
Working directory: $FileDir$
Everything should now everything work