我的想法是我想为 和 编写input[type=text]
静默input[type="password"]
类input[type=submit]
。然后,我会将@extend
它们作为变量传递给 mixin。
我的解析器抛出这个错误;
Syntax error: Invalid CSS after " @extend ": expected selector_sequence, was "$type;"
这是我的代码;
%text {
(text styling)
}
%password {
@extend %text;
}
%submit {
padding: .5em;
background-color: $button-color;
border: none;
cursor: pointer;
color: white;
border: 1px solid darken($button-color, 20%);
&:hover {
@include transition;
background-color: darken($button-color, 10%);
}
}
@mixin input($type) {
margin-bottom: 1.5em;
margin-left: 0;
outline: none;
@extend $type;
}
任何帮助,将不胜感激