0

suppose

.spacer(@property,@val){
        @val: @val1, @val2, @val3, @val4;
    .mixin() when (length(@list) = 2){
        @{property}:extract(@list, 1 2);
    }& when (length(@val) = 3){
        @{property}:extract(@list, 1 2 4);    
    }
    .mixin();
}

.spacer(margin, 2 1); Can one extract two values?

--less.js 2.5.3; windows 7; compiler winless.

vssadineni
  • 454
  • 4
  • 11
  • No, you can't use extract like that. I am not able to suggest any alternate as I can't really understand what you are trying to do. If you could add comments (or) explain your requirements it would be better. – Harry Nov 12 '15 at 12:32
  • this is achievable with @variable but I was trying with extract; for example .classname{padding:0.25em 0.125em} or .classname{padding:0.25em 0.125em 0.25em} – vssadineni Nov 13 '15 at 06:28
  • As I mentioned earlier, this is not possible with a single extract but maybe there is a better alternate to whatever you're trying to do. I (or other users) can suggest those only if we know what you are trying to do. – Harry Nov 13 '15 at 06:29

0 Answers0