本文介绍了SCSS和Sass有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我一直在读,Sass是一个使CSS变得更强大的语言,变量和数学支持。

From what I've been reading, Sass is a language that makes CSS more powerful with variable and math support.

与SCSS有什么区别?它应该是同一种语言吗?类似?不同?

What's the difference with SCSS? Is it supposed to be the same language? Similar? Different?

推荐答案

高级语法中的样式表由程序处理,并变成常规的CSS样式表。

Sass is a CSS pre-processor with syntax advancements. Style sheets in the advanced syntax are processed by the program, and turned into regular CSS style sheets. However, they do not extend the CSS standard itself.

这样做的主要原因是添加了CSS所缺乏的功能(如变量) )。

The main reason for this is the addition of features that CSS painfully lacks (like variables).

重新介绍SCSS和Sass之间的区别, Sass主页上的文字应该回答问题:

Re the difference between SCSS and Sass, the text on the Sass home page should answer the question:

Sass有两个语法。新的主要语法(从Sass 3开始)被称为SCSS(对于Sassy CSS)并且是CSS3的语法的超集。这意味着每个有效的CSS3样式表是有效的SCSS好。 SCSS文件使用扩展名.scss。

Sass has two syntaxes. The new main syntax (as of Sass 3) is known as "SCSS" (for "Sassy CSS"), and is a superset of CSS3’s syntax. This means that every valid CSS3 stylesheet is valid SCSS as well. SCSS files use the extension .scss.

第二个较旧的语法称为缩进语法(或简称Sass)。受到Haml的简洁性的启发,它适用于喜欢简洁的CSS。而不是括号和分号,它使用行的缩进来指定块。虽然不再是主要语法,缩进的语法将继续被支持。缩进语法中的文件使用扩展名.sass。

The second, 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. Although no longer the primary syntax, the indented syntax will continue to be supported. Files in the indented syntax use the extension .sass.

然而,所有这些仅适用于Sass预编译器创建CSS。它不是CSS标准本身的扩展。

However, all this works only with the Sass pre-compiler which in the end creates CSS. It is not an extension to the CSS standard itself.

这篇关于SCSS和Sass有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 23:25