关于DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. 的解决办法
问题
因为Dart sass 新版本目弃用“/”的用法,sass自定义element theme时会报warnning
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
Recommendation: math.div(ag-param(grid-size), 2)
More info and automated migrator: https://sass-lang.com/d/slash-div
╷
246 │ margin: ag-param(grid-size) / 2 0;
│ ^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules\@ag-grid-enterprise\all-modules\dist\styles\ag-theme-base\sass\parts\_widgets.scss 246:17 ag-theme-base-part-widgets() node_modules\@ag-grid-enterprise\all-modules\dist\styles\ag-theme-base\sass\_ag-theme-base-mixin.scss 39:5 ag-theme-base()
node_modules\@ag-grid-enterprise\all-modules\dist\styles\ag-theme-alpine\sass\_ag-theme-alpine-mixin.scss 8:5 ag-theme-alpine()
node_modules\@ag-grid-enterprise\all-modules\dist\styles\ag-theme-alpine\sass\ag-theme-alpine.scss 7:5 @import
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
解决办法
解决步骤如下:
- npm install -g sass-migrator
- 进入项目node_modules文件
- 执行sass-migrator division **/*.scss