1
我想從需要參數的Stylus mixin中擴展一個子規則,這可能嗎?繼承手寫筆mixin的子規則
這方面的一個例子使用bootstrap-stylus:
// Form validation states
//
// Used in forms.less to generate the form validation CSS for warnings, errors,
// and successes.
form-control-validation(text-color = #555, border-color = #ccc, background-color = #f5f5f5) {
// Color the label and help text
.help-block,
.control-label {
color: text-color;
}
// Set the border and box shadow on specific inputs to match
.form-control {
border-color: border-color;
box-shadow inset 0 1px 1px rgba(0,0,0,.075); // Redeclare so transitions work
&:focus {
border-color: darken(border-color, 10%);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(border-color, 20%);
}
}
// Set validation states also for addons
.input-group-addon {
color: text-color;
border-color: border-color;
background-color: background-color;
}
}
在這裏,我想以某種方式延長子規則.FORM控制,如:
.ui-state-valid
@extend form-control-validation($state-success-text, $state-success-text, $state-success-bg) .form-control
然而,這似乎並沒有工作。