我有以下LESS语句,试图在sudo类后面添加彩色背景:
scale_y_log10()
嵌套LESS语句中只有任何内容,例如:border-top:50px solid @ brand-red-light在渲染时不会进入屏幕。我试过拿出"&"签署并替换为">"但没有运气。我正在尝试用CSS绘制六边形。
答案 0 :(得分:2)
您的LESS正在创建以下CSS选择器:
.hexagon:after
.hexagon:after.red-light
.hexagon:after.red
.hexagon:after.red-dark
.hexagon:after.green-light
.hexagon:after.green
.hexagon:after.green-dark
我认为你的意思是产生这个:
.hexagon:after
.hexagon.red-light:after
.hexagon.red:after
.hexagon.red-dark:after
.hexagon.green-light:after
.hexagon.green:after
.hexagon.green-dark:after
如果是这样,请将您的LESS重新配置为以下内容:
.hexagon {
&:after {
content: "";
position: absolute;
bottom: -50px;
left: 0;
width: 0;
height: 0;
border-left: 100px solid transparent;
border-right: 100px solid transparent;
}
&.red-light:after {
border-top: 50px solid @brand-red-light;
}
&.red:after {
border-top: 50px solid @brand-red;
}
&.red-dark:after {
border-top: 50px solid @brand-red-dark;
}
&.green-light:after {
border-top: 50px solid @brand-green-light;
}
&.green:after {
border-top: 50px solid @brand-green;
}
&.green-dark:after {
border-top: 50px solid @brand-green-dark;
}
}