我试图发现为什么此LESS文件无法编译。我已经创建了一个基本的mixin和要解析的变量,但是由于某种原因它无法编译。
错误消息是:ParseError:无法识别的输入
在这一行:#placement-5-1.sidenav(@sidenav-colour)
有什么明显的我想念的东西吗?我是新手,正在为我的新工作学习它。感谢您的帮助。
#placement-5-1.sidenav(@sidenav-colour) {
.content-wrapper-inner {
ol.output-level-1 {
box-shadow: 0 0 4px rgba(0,0,0,.3);
> li {
> a {
background: @sidenav-colour;
color: @bright-white;
padding: 15px 10px;
position: relative;
padding-right: 40px;
&:after {
position: absolute;
right: 10px;
content: "\f063";
font-family: 'Font Awesome 5 Pro';
font-size: 2em;
top: 50%;
transform: translateY(-50%);
}
}
}
}
}
@media @mobile {
margin: 0px 9% !important;
}
}
@some-red: #e74c3c;
@some-blue: #3498db;
.sidenav.red { #placement-5-1.sidenav.red(@some-red) }
.sidenav.blue { #placement-5-1.sidenav.red(@some-blue) }
答案 0 :(得分:0)
您在哪里声明混音?根据您在此处发布的代码,似乎从未声明过变量@ sidenav-colour,因此它将是“无法识别的输入”。尝试使用本文来检查您是否正确使用了mixin https://www.sitepoint.com/a-comprehensive-introduction-to-less-mixins/