gpt4 book ai didi

less - 无法减少 grunt-contrib 以正确导入

转载 作者:行者123 更新时间:2023-12-01 03:52:29 25 4
gpt4 key购买 nike

我有以下少

.signature-overlay {
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: #000;
position: absolute;
**.opacity(.6);**
}

以及我的 grunt 文件中的以下内容...
less: {
development: {
options: {
paths: ["default/less","default/less/bootstrap"]
},
files: {
"css/less.css": ['less/*.less']
}
}
}

和在 default/less/bootstrap/mixins.less 中声明的不透明度
.opacity(@opacity) {
opacity: @opacity;
// IE8 filter
@opacity-ie: (@opacity * 100);
filter: ~"alpha(opacity=@{opacity-ie})";
}

但是当我运行 grunt 时,我得到...
Running "less:development" (less) task
>> NameError: .opacity is undefined in less/sigature.less on line 61, column 5:
>> 60 position: absolute;
>> 61 .opacity(.6);
>> 62 }
Warning: Error compiling less/signature.less Us
--force to continue.

最佳答案

问题是你需要像这样包含 mixins.less:

@import "bootstrap/mixins.less"; //I don't know you folder organizations

//..code...

.signature-overlay {
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: #000;
position: absolute;
.opacity(.6);
}

关于less - 无法减少 grunt-contrib 以正确导入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21119768/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com