2

我为网站的 CSS 开发了一些带有 .scss 脚本的 ruby​​ 应用程序。但我遇到了一个使用 .sass 的新 ruby​​ 应用程序。这种变化有什么好处或需要注意的地方吗?

4

3 回答 3

3

它们在功能上是等效的,但语法不同。从SASS 主页

[...] 它们之间没有功能差异。使用您喜欢的语法。

于 2013-06-01T16:54:43.737 回答
1

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.

文案

$blue: #3bbfce;
$margin: 16px;

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

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

}

萨斯

$blue: #3bbfce
$margin: 16px

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

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

在 sass 页面上查看更多信息

于 2013-06-01T16:56:14.370 回答
0

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

于 2013-06-01T16:55:03.383 回答