关于css:sass和scss之间有区别吗?

Is there a difference between sass and scss?

本问题已经有最佳答案,请猛点这里访问。

我已经使用.scss脚本为网站的CSS开发了一些ruby应用程序。 但我遇到了一个使用.sass的新ruby应用程序。
这种变化是否有任何优势或需要注意的事项?


它们在功能上是等效的,但具有不同的语法。 来自SASS主页:

[...] there is no functional difference between them. Use the syntax you prefer.


Sass是一种更简洁的Scss方法:

..Older syntax is known as the indented syntax (or just".sass"). Inspired by Haml’s terseness, it’s intended for people who prefer conciseness over similarity to CSS. Instead of brackets and semicolons, it uses the indentation of lines to specify blocks. Files in the indented syntax use the extension .sass.

SCSS

1
2
3
4
5
6
7
8
9
10
11
12
13
$blue: #3bbfce;
$margin: 16px;

.content-navigation {
  border-color: $blue;
  color:
    darken($blue, 9%);
}

.border {
  padding: $margin / 2;
  margin: $margin / 2;
  border-color: $blue;

}

萨斯

1
2
3
4
5
6
7
8
9
10
11
$blue: #3bbfce
$margin: 16px

.content-navigation
  border-color: $blue
  color: darken($blue, 9%)

.border
  padding: $margin / 2
  margin: $margin / 2
  border-color: $blue

查看sass页面上的更多信息


SASS和SCSS是相同的,但是使用了两种不同的语法。