重大变化
新版本的 Sass 尽可能向后兼容,但有时需要进行重大更改。Sass 需要跟上不断发展的 CSS 规范,并且旧的语言设计错误有时需要修复。
在发布每个重大更改之前,Sass 实现将为行为将发生变化的样式表生成弃用警告。只要有可能,这些警告将包括有关如何更新已弃用样式以使其向前兼容的建议。
¥Before each breaking change is released, Sass implementations will produce deprecation warnings for stylesheets whose behavior will change. Whenever possible, these warnings will include suggestions for how to update the deprecated styles to make them forward-compatible.
不同的实现对于重大变更和弃用有不同的政策。Dart Sass 将在发布重大更改之前至少三个月发出弃用警告,并将使用新的主要版本号发布重大更改,除非该更改对于 CSS 兼容性是必要的。CSS 兼容性更改通常既无中断性又具有时间敏感性,因此它们可能会以新的次要版本号发布。
¥Different implementations have different policies for breaking changes and deprecations. Dart Sass will emit deprecation warnings for at least three months before releasing a breaking change, and will release the breaking change with a new major version number unless that change is necessary for CSS compatibility. CSS compatibility changes are often both non-disruptive and time-sensitive, so they may be released with new minor version numbers instead.
这些重大更改即将推出或最近已发布:
¥These breaking changes are coming soon or have recently been released:
-
旧版 JS API 从 Dart Sass 1.79.0 开始。
¥The legacy JS API beginning in Dart Sass 1.79.0.
-
JS 颜色 API 的某些用途已弃用 从 Dart Sass 1.79.0 开始。
¥Certain uses of the JS color API are deprecated beginning in Dart Sass 1.79.0.
-
许多颜色函数已弃用 从 Dart Sass 1.79.0 开始,支持新的 CSS Color 4 兼容函数。
¥A number of color functions are deprecated beginning in Dart Sass 1.79.0, in favor of new CSS Color 4-compatible functions.
-
meta.feature-exists()
函数已弃用 从 Dart Sass 1.78.0 开始。¥The
meta.feature-exists()
function is deprecated beginning in Dart Sass 1.78.0. -
将声明与嵌套规则混合会改变行为 从 Dart Sass 1.77.7 开始。
¥Mixing declarations with nested rules is changing behavior beginning in Dart Sass 1.77.7.
-
以
--
开头的函数和 Mixins 已弃用 始于 Dart Sass 1.76.0。¥Functions and Mixins Beginning with
--
are deprecated beginning in Dart Sass 1.76.0. -
不推荐将百分比单位传递给全局
abs()
从 Dart Sass 1.65.0 开始。¥Passing a percentage unit to the global
abs()
is deprecated beginning in Dart Sass 1.65.0. -
将
null
作为 alpha 通道传递给new SassColor()
正在改变行为 从 Dart Sass 1.64.3 开始。¥Passing
null
as an alpha channel tonew SassColor()
is changing behavior beginning in Dart Sass 1.64.3. -
不再允许在 JS 中加载 Sass 作为默认导出 从 Dart Sass 1.63.0 开始。
¥Loading Sass as a default export in JS is no longer allowed beginning in Dart Sass 1.63.0.
-
变量只能有一个
!global
或!default
标志 从 Dart Sass 1.62.0 开始。¥A variable may only have a single
!global
or!default
flag beginning in Dart Sass 1.62.0. -
具有无效组合器的选择器无效 从 Dart Sass 1.54.0 开始。
¥Selectors with invalid combinators are invalid beginning in Dart Sass 1.54.0.
-
/
正在从除法运算更改为列表分隔符 从 Dart Sass 1.33.0 开始。¥
/
is changing from a division operation to a list separator beginning in Dart Sass 1.33.0. -
函数对于允许使用的单位更加严格 从 Dart Sass 1.32.0 开始。
¥Functions are stricter about which units they allow beginning in Dart Sass 1.32.0.
-
解析
@-moz-document
的特殊语法将无效 从 Dart Sass 1.7.2 开始。¥Parsing the special syntax of
@-moz-document
will be invalid beginning in Dart Sass 1.7.2. -
Dart Sass 1.0.0 和 Ruby Sass 4.0.0 中的 无法扩展复合选择器。
¥Compound selectors could not be extended in Dart Sass 1.0.0 and Ruby Sass 4.0.0.
-
Dart Sass 1.0.0、LibSass 3.5.0 和 Ruby Sass 3.5.0 中的 CSS 自定义属性值的语法已更改。
¥The syntax for CSS custom property values changed in Dart Sass 1.0.0, LibSass 3.5.0, and Ruby Sass 3.5.0.
提前选择加入提前选择加入 permalink
¥Early Opt-In
Dart Sass 用户可以选择尽早使用 --fatal-deprecation
命令行选项 将弃用视为错误。
¥Dart Sass users can opt in to treat deprecations as errors early using the
--fatal-deprecation
command line option.