ElementPlus从beta版本升级到2.2.17,css打包报错,有没有热心人帮忙看下?
老项目从ElementPlus从beta版本升级到2.2.17,本地启动正常,打包的时候报错,提示
Error: CSS minification error: Lexical error on line 1: Unrecognized text.
Erroneous area:
1: var( --el-input-height, 32px ) - $border-width * 2
^...................................^. File: css/app.11f79806.css
Error: CSS minification error: Lexical error on line 1: Unrecognized text.
我搜了下网上说这个是因为变量要放在calc()里面,但是这个代码是element-plus里的
@include e(inner) {
@include set-css-var-value(
'input-inner-height',
calc(
var(
#{getCssVarName('input-height')},
#{map.get($input-height, $size)}
) - $border-width * 2
)
);
}
}
而且看上去是正常的,为什么会报错呢,有没有大神帮忙看下
回复
1个回答

test
2024-07-01
使用变量时以如下方式使用:scss的calc中的变量使用方式 需要以 #{变量名} 的方式使用
var(
#{getCssVarName('input-height')},
#{map.get($input-height, $size)}
) - #{$border}-width * 2
回复

适合作为回答的
- 经过验证的有效解决办法
- 自己的经验指引,对解决问题有帮助
- 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
- 询问内容细节或回复楼层
- 与题目无关的内容
- “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容