Sass for the CSS to give the characteristics of dynamic language, such as variables, inheritance, operations, functions, etc., more convenient for the writing and maintenance of CSS!
Sass Installation
Because SASS relies on the ruby environment, make sure Ruby is installed before installing SASS. Install Ruby http://www.jb51.net/article/61501.htm
After installing Ruby, in the Start menu, locate the ruby that we just installed, open the start Command Prompt with Ruby
And then enter directly into the command line
Copy Code code as follows:
Press ENTER to confirm, wait a period of time will prompt you sass installs successfully.
The command detection installation is complete enough:
If you want to install a beta version of, you can enter at the command line
Copy Code code as follows:
Using SASS
Sass files are plain text files that can be used directly in CSS syntax. The file suffix name is. scss, meaning sassy CSS.
The following command allows you to display the CSS code for the. scss file transformation on the screen. (Suppose the file name is test.) )
Copy Code code as follows:
If you want to save the displayed results to a file, follow a. css file name.
Copy Code code as follows:
SASS offers four compilation-style options:
Copy Code code as follows:
* Nested: Nested indented CSS code, which is the default value.
* Expanded: No indented, extended CSS code.
* Compact: Concise format CSS code.
* Compressed: Compressed CSS code.
In a production environment, the last option is generally used.
Copy Code code as follows:
Sass--style Compressed Test.sass test.css
You can also have Sass monitor a file or directory and automatically generate the compiled version once the source file has changed.
Copy Code code as follows:
Listening for files
Sass--watch Input.scss:output.css
Listening folders
Sass--watch App/sass:public/stylesheets