Javatpoint Logo



Javatpoint Logo

SASS Example

We can simply create SASS and SCSS example. To do so, use the following steps:

Create a HTML file having the following code:

See this example:

Now create a file named "style.scss". It is similar to CSS file. The only one difference is that it is saved with ".scss" extension. Put the both file inside the root folder.

Now, execute the following code: sass --watch style.scss:style.css

SASS Instasll10

It will create a new CSS file named "style.css" inside the root folder automatically. Whenever you change the SCSS file, the style.css file will changed automatically.

The style.css file has the following code:

SASS Instasll11

Now execute the HTML file. It will read the CSS file and the output would be like this:


SASS Instasll12
Next TopicSass Syntax

Latest 4 Tutorials on JavaTpoint