【发布时间】:2013-07-09 20:19:29
【问题描述】:
我的想法是我想为input[type=text]、input[type="password"] 和input[type=submit] 编写静默类。然后我会将它们作为变量传递给 mixin 中的 @extend 它们。
我的解析器抛出这个错误;
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;
}
任何帮助将不胜感激
【问题讨论】: