Answer the question
In order to leave comments, you need to log in
How to specify multiple CSS property values in LESS?
Good afternoon!
In general, the essence of the question is this: There is a code
.b-shadow (@type:0, @x: 0, @y: 0, @blur: 0, @color: #fff) when (@type=0) {
box-shadow: @x @y @blur @color;
-moz-box-shadow: @x @y @blur @color;
-webkit-box-shadow: @x @y @blur @color;
filter: progid:DXImageTransform.Microsoft.dropshadow([email protected], [email protected], color=@color);
}
.b-shadow (@type, @x: 0, @y: 0, @blur: 0, @color: #fff) when (@type = inset){
box-shadow: @arguments;
-moz-box-shadow: @arguments;
-webkit-box-shadow: @arguments;
}
.b-shadow(0, 0, 5px, 0, #51bad7);
box-shadow+: 0 10px 15px rgba(0,0,0,0.2);
.b-shadow (@type:0, @x: 0, @y: 0, @blur: 0, @color: #fff) when (@type=0) {
box-shadow+: @x @y @blur @color;
-moz-box-shadow+: @x @y @blur @color;
-webkit-box-shadow+: @x @y @blur @color;
filter: progid:DXImageTransform.Microsoft.dropshadow([email protected], [email protected], color=@color);
}
.b-shadow (@type, @x: 0, @y: 0, @blur: 0, @color: #fff) when (@type = inset){
box-shadow+: @arguments;
-moz-box-shadow+: @arguments;
-webkit-box-shadow+: @arguments;
}
box-shadow: 0 5px 0 #51bad7, 0 10px 15px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 0 #51bad7;
-webkit-box-shadow: 0 5px 0 #51bad7;
Answer the question
In order to leave comments, you need to log in
Personally, I do it a little differently.
.shadow (@shadow) {
-webkit-box-shadow: @shadow;
-moz-box-shadow: @shadow;
box-shadow: @shadow;
}
.class1 { .shadow(~"1px 2px red, inset 5px 5px green");}
Thank you!
Itself did not think that it is possible to transfer at once all arguments in the form of a line.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question