我试图将CSS编译为SCSS,我得到这个错误


{
"status": 1,
"file": "E:/Natours/sass/main.scss",
"line": 31,
"column": 5,
"message": "argument `$alpha` of `rgba($color, $alpha)` must be a number",
"formatted": "Error: argument `$alpha` of `rgba($color, $alpha)` must be a numbern        on line 31 of sass/main.scss, in function `rgba`n        from line 31 of sass/main.scssn>>     rgba($color-primary-light, o.8),rn   ----^n"
}

这是控制台的错误:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! natours@1.0.0 compile:sass: `node-sass sass/main.scss css/style.css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the natours@1.0.0 compile:sass script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersSAHILAppDataRoamingnpm-cache_logs2021-09-02T01_47_56_926Z-debug.log

看起来不透明度不能作为一个变量发送,尝试发送一个适当的数字代替:

rgba($color, 0.88);

最新更新