Sass Study Notes (a): Sass installation, compilation under Windows

Source: Internet
Author: User

One, sass installation under Windows

Installing Ruby under the Windows platform requires a Ruby installation package, which you can download here:

https://www.ruby-lang.org/en/downloads/

After the Ruby installation file is downloaded, you can install Ruby by following the application installation steps.

After the ruby installation is complete, locate the newly installed Ruby in the Start menu and launch the Command Control Panel for Ruby Start command Prompt with Ruby. The next step is to install Sass.

1. Install Sass by command

Open your computer's command terminal and enter the following command:

Gem Install Sass

To remind you, in the use of the MAC classmate, may need to add "sudo" before the above command to install properly:

sudo gem install sass

If the above method is not successfully installed, you can use the following two methods.

2. Install Sass via Compass

In addition to using the Gem command to install Sass, you can install Sass by installing compass because compass is a framework based on Sass development. In other words, you install the Compass, and you install the Sass as well.

Similarly, enter the following command at your command terminal:

sudo gem install sass

After executing the above command, the installation of Compass and Sass is started.

Note: Compass is a mature, Sass-based framework that integrates a number of well-written mixins and Sass functions. But there is no more elaboration on this.

3, Local installation Sass

Since sometimes the direct use of the above command installation will make it impossible for you to implement the installation (Network limited reason), when encountered this situation, then the installation needs special to handle, you can use the following method to achieve the normal installation of Sass:

You can download the Sass installation package (Http://rubygems.org/gems/sass) to the Rubygems (http://rubygems.org/) website and enter it at the command terminal:

Gem Install < Drag the downloaded installation package here >

The direct carriage return can be successfully installed.

Note: On the IOSX system platform, you can drag the downloaded installation package directly after the "gem install", if you are a Windows system, you need to enter the file path of the installation.

Second, sass in the detection, update, uninstall

On the command line, start command Prompt with Ruby, enter the commands:

Sass-v Search and test

GEM Update Sass Update Sass

Gem Uninstall Sass Uninstall Sass

SCSS is a new syntax format for SASS, which can be indented, with curly braces, semicolons, and sass different from the writing format and the file name extension.


Third, the compilation of sass

1, command-line compilation:

Single-file compilation: Sass < input path >/style.scss:< output path >/style.css

Multi-file compilation: Sass sass/:css/

The above command means that all ". Scss" (". Sass") files in the "Sass" folder in the project are compiled into a ". css" file, and these CSS files are placed in the project's "CSS" folder.

Watch function on the command line:

Let's look at a simple example, assuming I have a project locally, I'm going to compile the project "Bootstrap.scss" into a "bootstrap.css" file, and put the compiled file in the "CSS" folder, and I can do it in my command terminal:

Sass--watch Sass/bootstrap.scss:css/bootstrap.css

Once I have any changes to my bootstrap.scss file, as long as I save the modified file again, the command terminal can monitor and recompile the file.

2. GUI Interface Tool compilation

Recommended Koala, Codekit these two visual tools compile, specific can be downloaded online.


3. Automated compilation

Grunt, gulp can be automatically compiled.


Sass Study Notes (a): Sass installation, compilation under Windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.