Google News
logo
Sass - Interview Questions
Why Use Sass? A Simple Example why Sass is Useful?
Stylesheets are getting larger, more complex, and harder to maintain. This is where a CSS pre-processor can help.
 
Sass lets you use features that do not exist in CSS, like variables, nested rules, mixins, imports, inheritance, built-in functions, and other stuff.
 
Example :
/* define variables for the primary colors */
$primary_1: #a2b9bc;
$primary_2: #b2ad7f;
$primary_3: #878f99;

/* use the variables */
.main-header {
  background-color: $primary_1;
}

.menu-left {
  background-color: $primary_2;
}

.menu-right {
  background-color: $primary_3;
}

 

Advertisement