【问题标题】:Nativescript angular DEPRECATION WARNING: Using / for division is deprecatedNativescript Angular DEPRECATION WARNING:不推荐使用 / 进行除法
【发布时间】: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


    【解决方案1】:

    我使用自动迁移从这里解决了这个问题:https://sass-lang.com/documentation/breaking-changes/slash-div

    在 node_modeules 文件夹上完成。

    所以我关注了:

    1. 安装迁移器

    npm install -g sass-migrator

    1. 转到 node_modules

    cd node_modules

    1. 迁移(node_modules 文件夹中的所有 scss)

    sass-migrator 部门 **/*.scss

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-18
      • 1970-01-01
      • 2020-05-26
      • 1970-01-01
      • 2017-08-27
      • 1970-01-01
      • 2022-06-14
      • 2016-07-06
      相关资源
      最近更新 更多