本文介绍了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?

推荐答案

Sass 是一个具有语法改进的 CSS 预处理器.高级语法中的样式表由程序处理,并转换为常规的 CSS 样式表.但是,它们没有扩展 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 变量,但不如预处理器变量好.

CSS variables are supported and can be utilized but not as well as pre-processor variables.

关于SCSS和Sass的区别,Sass文档页面上的这段文字 应该回答这个问题:

For the difference between SCSS and Sass, this text on the Sass documentation page should answer the question:

Sass 有两种可用的语法.第一个称为 SCSS (Sassy CSS) 并在本参考文献中使用,是 CSS 语法的扩展.这意味着每个有效的 CSS 样式表都是一个具有相同含义的有效 SCSS 文件.这种语法通过下面描述的 Sass 功能得到了增强.使用此语法的文件具有 .scss 扩展名.

第二种和旧语法,称为缩进语法(有时简称为Sass"),提供了一种更简洁的方式编写 CSS.它使用缩进而不是括号来指示选择器的嵌套,并换行而不是分号来分隔属性.使用此语法的文件具有 .sass 扩展名.

The second and older syntax, known as the indented syntax (or sometimes just "Sass"), provides a more concise way of writing CSS. It uses indentation rather than brackets to indicate nesting of selectors, and newlines rather than semicolons to separate properties. Files using this syntax have the .sass extension.

然而,所有这些只适用于最终创建 CSS 的 Sass 预编译器.它不是 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