When it comes to using similarities in my code, I often find myself needing a more flexible solution. For example:
.position{
position:absolute;
right:10px;
top:20px;
}
This is where the idea of using a mixin
comes in handy:
.position(@absolute:absolute;@top:0;@right:0;@bottom:0;@left:0){
position: @absolute;
top:@top;
right: @right;
bottom:@bottom;
left:@left;
}
However, there are times when I don't need the right
property injected into my code. So, how can I modify the mixin to achieve the following result?
.position(@absolute:absolute;@top:12px;@left:12px;@bottom:12px);
//without 'right'
.position{
position: absolute;
top:12px;
bottom:12px;
left:12px;
}
If anyone has any suggestions or solutions, I would greatly appreciate it!