I've made the following two Mixins:
.responsive_color(@color, @response_color, @speed: 0.1s){
color: @color;
.transition(color, @speed);
&:hover, &:active, &:focus{
color: @response_color;
}
}
.responsive_background(@color, @response_color, @speed: 0.1s){
background-color: @color;
.transition(background-color, @speed);
&:hover, &:active, &:focus{
background-color: @response_color;
}
}
Since these two are nearly identical I want to combine them into something like this:
.responsive(@property, @color, @response_color, @speed: 0.1s){
@property: @color;
.transition(@property, @speed);
&:hover, &:active, &:focus{
@property: @response_color;
}
}
While this doesn't cause errors in the LESS parser (PHP class) it is simply ignored. I've also tried @{property} and '@{property}' but both of these cause errors.
Does anyone know how I can output @property to be properly parsed? Or am I trying to do something that isn't possible?