Ruby

Implement SASS Code And Convert It Into CSS By Ruby

For this implementation First, we need to know Ruby. If you don’t know how to install Ruby, First read this article.

Testing SASS

Let’s make sure everything is working. First, execute the following command:

sass -v

Output:

After execution, you can see the version of SASS installed on your system.

Now let’s try some actual SASS code. Fire up your editor and create a new file named style.scss.

Enter the following code, and save the file.

$primary_color : #000000;

body {
  text-color: $primary_color;
}

Now go back to your command prompt window, make sure you’re in the folder where you created the file, and execute the following command:

sass style.scss style.css

Output:

The SASS transpiler will create the style.css file in the folder named css. If you open it in your editor, it should look like this:

body {
  text-color: #000000;
}

Congratulations! You have just written your first piece of SASS code and transpiled it into CSS.

Rahul Chopda

Rahul Chopda is a web designer and front-end web developer with experience in HTML, CSS, jQuery also Author at TheCodeHubs.

Share
Published by
Rahul Chopda

Recent Posts

Testing hk

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Operation

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

TETS NEW

test

3 years ago