Arp
Arp

Reputation: 146

Mixins: passing argument to the 3rd parameter only

I'm new in Less and have a problem about this...

I have this code

//Mixin

.border(@width: 1px, @type: solid, @color: #fff){
      border: @arguments;
}

//Implementation

.class{
     .border(#ff0000);
}

Is there any possibility to change only @color param in border mixin.When I set value to @arguments, it don't give me possibility to change one of params. Maybe there is a smarter way to code this..Thanks

Upvotes: 4

Views: 69

Answers (1)

haim770
haim770

Reputation: 49095

Just use Named Parameters:

.class {
      .border(@color: #ff0000);
}

Upvotes: 3

Related Questions