Hello SASS

Steps

Step 1

Install the gem.

$ gem install compass

Step 2

View the help.

$ compass -h

Step 3

Create a project called hello.

$ compass create hello

Step 4

Add hello.scss file to sass folder.

$header-color: #fe3242;

h1 {
    color: $header-color;
}

Step 5

Compile the hello.scss file.

$ compass compile ./sass/hello.scss

This will create stylesheets/hello.css file in stylesheets folder. The contents are:

/* line 3, ../sass/hello.scss */
h1 {
  color: #fe3242;
}

Summary

In this article, we created a simple hello sass project and compiled a scss file to create a css file. You can browse the source code at https://github.com/bparanj/hicompass. You can learn more from the compass home page.


Related Articles


Create your own user feedback survey