Dru*_*ney 5 css sass node.js twitter-bootstrap bootstrap-4
我正在使用SCSS来改变bootstrap 4的样式来创建我自己的样式,但是当我编译我的SCSS时,我得到了这个错误:
{
"status": 1,
"file": "H:/!WEBSITE/modules/The Force - Bootstrap/content/scss/variables/variables.scss",
"line": 330,
"column": 34,
"message": "Incompatible units: 'px' and 'px*px'.",
"formatted":
"Error: Incompatible units: 'px' and 'px*px'.
on line 330 of scss/variables/variables.scss
>> $input-height: (($font-size-base * $input-line-height) + ($input-padding-y * 2)) !default;"
}
Run Code Online (Sandbox Code Playgroud)
我的变量值:
$font-size-base: 14px !default;
$line-height-base: 1.846 !default;
$input-line-height: floor(($font-size-base * $line-height-base)) !default;
$input-padding-y: 6px !default;
Run Code Online (Sandbox Code Playgroud)
弹出错误的行:
$input-height: (($font-size-base * $input-line-height) + ($input-padding-y * 2)) !default;
Run Code Online (Sandbox Code Playgroud)
我不明白为什么它不起作用,我更了解如何解决它.我使用node-sass编译SCSS,我不认为问题来自node-sass,因为它不是我第一次使用它而且我整天都在使用它而没有出现任何类似的错误.
您的问题是,你是乘px用px,导致px2
所以px从变量中 删除$font-size-base
$font-size-base: 14 !default;
$line-height-base: 1.846 !default;
$input-line-height: floor(($font-size-base * $line-height-base)) !default;
$input-padding-y: 6px !default;
$input-height: (($font-size-base * $input-line-height) + ($input-padding-y * 2)) !default;
Run Code Online (Sandbox Code Playgroud)
参见DEMO
上海社会科学院有关单位更多信息点击这里
| 归档时间: |
|
| 查看次数: |
4028 次 |
| 最近记录: |