Monday, 01 July 2019 08:18

What is css pre-processor and how to use it

Written by 
Rate this item
(0 votes)

Sass is called css pre-processor which reduces repetition 

of css codes and this way saves time. 

 Let's say we need to set following three css values. So many 

many times you need to type those values. Instead of typing 

these values a lot of times, why not use sass and write like this:

/* Define variables and values for site */

$bgcolor: lightblue;

$txtcolor: blue;

$fontsize: 16px;

/* Use those variables */

body {

  background-color: $bgcolor;

  color: $txtcolor;

  font-size: $fontsize;

}

Browser does not get Sass code. So, you need a Sass 

pre-processor to convert Sass code into normal css 

by a process called transpiling. 

Read 1887 times Last modified on Monday, 01 July 2019 08:24
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.

Latest discussions

  • No posts to display.