开发者

Multiple Parameters in Less.Js

开发者 https://www.devze.com 2023-02-25 09:35 出处:网络
Can I use multiple parameters in a class? For instance I\'d like to give a div both border radius and a background color. How would I do this?

Can I use multiple parameters in a class? For instance I'd like to give a div both border radius and a background color. How would I do this?

Here is an example of what I am trying to do:

.button (@radius, @color) {
  border-radius: @radius;
  -moz-border-radius: @radius;
  -webkit-border-radius:开发者_C百科 @radius;
  background:@color;
}


The correct way is to separate them by commas.

.button (@radius 4px, @color #000) {
   border-radius: @radius;
   -moz-border-radius: @radius;
   -webkit-border-radius: @radius;
   background:@color;
}

Don't separate them by semi colons.

0

精彩评论

暂无评论...
验证码 换一张
取 消