From what I've been reading, Sass is a language that makes CSS more powerful with variable and math support.
What's the difference with SCSS? Is it supposed to be the same language? Similar? Different?
From what I've been reading, Sass is a language that makes CSS more powerful with variable and math support.
What's the difference with SCSS? Is it supposed to be the same language? Similar? Different?
The basic difference is the syntax. While SASS has a loose syntax with white space and no semicolons, the SCSS resembles more to CSS.
The Sass
.sass
file is visually different from.scss
file, e.g.Example.sass - sass is the older syntax
Example.scss - sassy css is the new syntax as of Sass 3
Any valid CSS document can be converted to Sassy CSS (SCSS) simply by changing the extension from
.css
to.scss
.Difference between SASS and SCSS article explains the difference in details. Don’t be confused by the SASS and SCSS options, although I also was initially, .scss is Sassy CSS and is the next generation of .sass.
If that didn’t make sense you can see the difference in code below.
In the code above we use ; to separate the declarations. I’ve even added all the declarations for .border onto a single line to illustrate this point further. In contrast, the SASS code below must be on different lines with indentation and there is no use of the ;.
You can see from the CSS below that the SCSS style is a lot more similar to regular CSS than the older SASS approach.
I think most of the time these days if someone mentions that they are working with Sass they are referring to authoring in .scss rather than the traditional .sass way.
Eample of some SCSS and SASS syntax
SCSS
SASS
Output CSS after Compilation(Same for Both)
For more refer official website
From the homepage of the language
SASS is an interpreted language that spits out CSS. The structure of Sass looks like CSS (remotely), but it seems to me that the description is a bit misleading; it's not a replacement for CSS, or an extension. It's an interpreter which spits out CSS in the end, so Sass still has the limitations of normal CSS, but it masks them with simple code.
Sass was the first one, and The syntax is a bit diffrent. For example, including a mixin:
Sass ignores curly brackets and semi colons and lay on nesting, which I found more useful.