Difference between SCSS and SASS
15 October 2023
If you are a web developer, you might have heard of Sass, a CSS preprocessor that makes writing and maintaining stylesheets easier and more efficient. But did you know that Sass has two different syntaxes: SCSS and Sass?
In this blog post, we will explain the difference between SCSS and Sass, and help you decide which one to use for your projects.
What is Sass?
Sass (Syntactically Awesome Style Sheets) is a preprocessor scripting language that extends the functionality of CSS. With Sass, you can use features like variables, nesting, inheritance, mixins, functions, and operators to write more concise and reusable code. Sass also allows you to import other Sass files, use partials and modules, and create custom output formats.
Sass is compiled into plain CSS by a program called a Sass compiler. There are many Sass compilers available, such as Dart Sass, LibSass, Ruby Sass, and Node-sass. You can also use tools like Webpack, Gulp, or Grunt to automate the compilation process.
What is SCSS?
SCSS (Sassy CSS) is the main syntax for Sass. It uses the file extension .scss and has a syntax that is very similar to CSS. In fact, SCSS is a superset of CSS, which means that any valid CSS code is also valid SCSS code. SCSS uses curly braces and semicolons to indicate blocks and statements, just like CSS.
Here is an example of SCSS code:
As you can see, SCSS allows you to use variables to store values that can be reused throughout your code. You can also use nesting to group related selectors and avoid repetition. SCSS also supports other features like inheritance, mixins, functions, and operators that are not available in plain CSS.
What is Sass?
Sass is the original syntax for Sass. It uses the file extension .sass and has a syntax that is more concise and readable than SCSS. Sass does not use curly braces or semicolons to indicate blocks and statements. Instead, it uses indentation and whitespace to define the structure of the code.
Here is the same example as above, but written in Sass:
scss
/* SCSS */
$primary-color: green;
$primary-bg: red;
body {
color: $primary-color;
background: $primary-bg;
}


