Project compilation - Sass

This is sub-layout for documentation pages

Top

1 Introduction

Sass is css preprocesor. It is necessary only for developing the main webpage, which is written in Nette.
The main reason was that all the styles got long, as page got bigger.

For instalation, I strongly recommend to use the cleaner instalation method
Sass can be installed using npm:

    sudo npm install node-sass -g
  

It is possible, that it will throw error during instalation. If that happens, this command worked for me...:

    sudo npm install --unsafe-perm -g node-sass
  

Additionally, sass auto compile module is good for Atom.


Here is example of valid scss code:

  nav {
    ul {
      margin: 0;
      padding: 0;
      list-style: none;
    }

    li { display: inline-block; }

    a {
      display: block;
      padding: 6px 12px;
      text-decoration: none;
    }
  }
  

which is compiled to following css code:

    nav ul{margin:0;padding:0;list-style:none}nav li{display:inline-block}nav a{display:block;padding:6px 12px;text-decoration:none}

2 Easy and clean instalation

The problem can be that npm-related sass is not compatible with nodeJS of version 10. It can be resolved by installing the binary for sass, instead of the npm-version (which is javasctipt implementation of sass processor)