gpt4 book ai didi

syntax - 我应该使用 Sass 还是 Scss 进行编码?

转载 作者:行者123 更新时间:2023-12-02 07:17:34 25 4
gpt4 key购买 nike

与 Scss 语法相比,我更喜欢 Sass 语法,但我注意到后者更流行,而且我担心在 Sass 中工作并且在更高版本中不再支持它。如果这是一个重复的问题,我很抱歉,我在搜索栏中找不到任何答案。

最佳答案

这是官方的解释SASS website

Sass is an extension of CSS that adds power and elegance to the basic language. It allows you to use variables, nested rules, mixins, inline imports, and more, all with a fully CSS-compatible syntax. Sass helps keep large stylesheets well-organized, and get small stylesheets up and running quickly, particularly with the help of the Compass style library.

There are two syntaxes available for Sass. The first, known as SCSS (Sassy CSS) and used throughout this reference, is an extension of the syntax of CSS3. This means that every valid CSS3 stylesheet is a valid SCSS file with the same meaning. In addition, SCSS understands most CSS hacks and vendor-specific syntax, such as IE’s old filter syntax. This syntax is enhanced with the Sass features described below. Files using this syntax have the .scss extension.

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. Some people find this to be easier to read and quicker to write than SCSS. The indented syntax has all the same features, although some of them have slightly different syntax; this is described in the indented syntax reference. Files using this syntax have the

SASS 受到 HAML 的启发,并使用了缩进约定。对于不是来自HAML世界的人来说不太方便。因此创建了新语法 SCSS,它是普通 CSS 语法的超集。

回答你的问题我应该使用 Sass 还是 Scss 进行编码?

您最好使用SCSS,因为不能保证SASS的预编译器将得到长期支持

关于syntax - 我应该使用 Sass 还是 Scss 进行编码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19721708/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com