文档

Sass 是一种编译为 CSS 的样式表语言。它允许你使用 变量嵌套规则混入函数 等,所有这些都具有完全 CSS 兼容的语法。Sass 有助于使大型样式表组织良好,并可以轻松地在项目内和项目间共享设计。

  • 如果你正在寻找 Sass 简介,请查看 教程

    ¥If you’re looking for an introduction to Sass, check out the tutorial.

  • 如果你想查找内置的 Sass 函数,那么 内置模块参考 就是你的最佳选择。

    ¥If you want to look up a built-in Sass function, look no further than the built-in module reference.

  • 如果你从 JavaScript 调用 Sass,你可能需要 JS API 文档

    ¥If you’re calling Sass from JavaScript, you may want the JS API documentation.

  • 或者如果你从 Dart 调用它,则为 Dart API 文档

    ¥Or the Dart API documentation if you’re calling it from Dart.

  • 否则,请使用目录作为语言参考!

    ¥Otherwise, use the table of contents for the language reference!

旧版本旧版本 permalink

¥Older Versions

本文档是针对最新版本的 Sass 语言编写的。如果你使用的是 Dart Sass ,你将可以使用此处描述的所有功能。但如果你使用旧版本的 Dart Sass 或已弃用的 Sass 实现(例如 LibSassRuby Sass),则可能会存在一些行为差异。

¥This documentation is written for the most recent version of the Sass language. If you’re using Dart Sass , you’ll have access to all the features described here. But if you’re using an older version of Dart Sass or a deprecated Sass implementation like LibSass or Ruby Sass, there may be some behavioral differences.

只要版本或实现之间的行为有所不同,文档就会包含一个兼容性指示符,如下所示:

¥Anywhere behavior differs between versions or implementations, the documentation includes a compatibility indicator like this:

兼容性 (Feature Name):
Dart Sass
LibSass
since 3.6.0
Ruby Sass

"✓" 的实现完全支持相关功能,而 "✗" 的实现则不支持全部功能。具有版本号的实现开始支持该版本的相关功能。实现也可以标记为 "局部":

¥Implementations with a "✓" fully support the feature in question, and implementations with a "✗" don’t support it all. Implementations with a version number started supporting the feature in question at that version. Implementations can also be marked as "partial":

兼容性:
Dart Sass
LibSass
partial
Ruby Sass

其他详细信息请参见此处。

¥Additional details go here.

这表明该实现仅支持该功能的某些方面。这些兼容性指示器(以及许多其他指示器)有一个 "➤" 按钮,单击该按钮可以显示有关实现的具体差异以及哪些版本支持相关功能的哪些方面的更多详细信息。

¥This indicates that the implementation only supports some aspects of the feature. These compatibility indicators (and many others) have a "➤" button, which can be clicked to show more details about exactly how the implementations differ and which versions support which aspects of the feature in question.