其他分享
首页 > 其他分享> > Using / for division is deprecated and will be removed in Dart Sass 2.0.0._@jie

Using / for division is deprecated and will be removed in Dart Sass 2.0.0._@jie

作者:互联网

问题描述

新写项目编译时,遇到sass语法报错,现已解决,记录一下

EPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($px, $html-font-size)

More info and automated migrator: https://sass-lang.com/d/slash-div

   ╷
18 │   @return $px / $html-font-size * 1rem;
   │           ^^^^^^^^^^^^^^^^^^^^^
   ╵
    src\assets\scss\variable.scss 18:11  computer()
    src\assets\scss\coverAntd.scss 4:16  @import
    src\assets\scss\index.scss 8:9       @import
    stdin 477:9                          root stylesheet

解决方案

"sass": "^1.43.4",    替换为  "sass": "~1.26.5",
  1. 将package.json文件内sass版本号进行以上示例的修改
  2. 删除原有的node_modules文件夹所有内容
  3. npm install
  4. 重新启动就

    标签:scss,division,font,Sass,sass,src,import,2.0,assets
    来源: https://blog.csdn.net/tattoo_jie/article/details/122255508