我试图根据我在scss中输入的内容在HTML中添加字符串the color is green
。
@mixin jeansColor($jeancolor) {
if(type-of($jeancolor)==string) {
content: "the color is green"
}
}
.jeans:after {
@include jeansColor("green");
}
<p class="jeans"> Jeans </p>
答案 0 :(得分:1)
细节总是如此……只是忘了用@
:CodePen :)实例化if
@mixin jeansColor($jeancolor) {
@if(type-of($jeancolor)==string) {
content: "the color is green"
}
}
.jeans:after {
@include jeansColor("green");
}
<p class="jeans"> Jeans </p>