Open In App

What is the difference between SCSS and SASS ?

SASS (Syntactically Awesome Style Sheets) is a pre-processor scripting language that will be compiled or interpreted into CSS. SassScript is itself a scripting language whereas SCSS is the main syntax for the SASS which builds on top of the existing CSS syntax. It makes use of semicolons and brackets like CSS (Cascaded Style Sheets).
SASS and SCSS can import each other. Sass actually makes CSS more powerful with math and variable support. 
Let’s list down the main difference between SASS and SCSS. 
 

SCSS Example: 
 






/* .scss file */
$bgcolor: blue;
$textcolor: red;
$fontsize: 25px;
 
/* Use the variables */
body {
  background-color: $bgcolor;
  color: $textcolor;
  font-size: $fontsize;
}

Output CSS: 
 

body {
  background-color: blue;
  color: red;
  font-size: 25px;
}
/* now this can apply resulting html file */

SASS Example: 






/* SASS */
 
$primary-color: green
$primary-bg: red
 
body
  color: $primary-color
  background: $primary-bg

Output CSS:

/* CSS */
body {
  color: green;
  background: red;
}

CSS is the foundation of webpages, is used for webpage development by styling websites and web apps.You can learn CSS from the ground up by following this CSS Tutorial and CSS Examples.

Article Tags :