【发布时间】:2021-06-21 19:42:51
【问题描述】:
在构建 nativescript-angular 应用程序期间,我收到了一些关于使用 / 进行除法的 scss 警告,因为它似乎很快就会被弃用。
例子:
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
Recommendation: math.div(blue($color) * 114, 1000)
More info and automated migrator: https://sass-lang.com/d/slash-div
╷
75 │ $color-brightness: round((red($color) * 299) + (green($color) * 587) + (blue($color) * 114) / 1000);
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules\@nativescript\theme\scss\mixins\_utilities.scss 75:76 check-contrast()
node_modules\@nativescript\theme\scss\mixins\_utilities.scss 84:49 alternate()
node_modules\@nativescript\theme\scss\variables\_index.scss 56:11 @import
node_modules\@nativescript\theme\scss\core\_index.scss 2:9 @import
node_modules\@nativescript\theme\core.scss 8:9 @import
src\_app-common.scss 1:9 @import
src\app.android.scss 2:9 root stylesheet
注意:此警告出现在几个地方。在 nativescript CLI 生成的新项目中可以看到警告。
如警告消息中所建议的那样 - 可以使用 math.div 重写除法。
【问题讨论】:
标签: sass nativescript