2013-06-01 61 views
1

我已經使用.scss腳本爲網站的CSS編寫了幾個Ruby應用程序。但我遇到了一個新的使用.sass代替的ruby應用程序。 有沒有任何優點或事情要注意這一變化?sass和scss有區別嗎?

回答

3

它們在功能上等同,但語法不同。從SASS homepage

[...],它們之間不存在區別。使用你喜歡的語法。

0

SASS和SCSS是一樣的東西,但是有兩種不同的語法。

+0

@downvoter,敢解釋一下嗎? – Lucero

1

薩斯是讓一個更清潔的方式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

$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 

Check more info on sass page