css - Splitting Multiple LESS arguments -


i have mixin:

.gradient(@alpha, ...) {     @r: extract(@arguments,1);     @g: extract(@arguments,2);     @b: extract(@arguments,3);      background: -moz-linear-gradient(top,  rgba(@r,@g, @b, .2) 0%, rgba(0,0,0,@alpha) 100%);     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(@r,@g, @b, .2)), color-stop(100%,rgba(0,0,0,@alpha)));     background: -webkit-linear-gradient(top,  rgba(@r,@g, @b, .2) 0%,rgba(0,0,0,@alpha) 100%);     background: -o-linear-gradient(top,  rgba(@r,@g, @b, .2) 0%,rgba(0,0,0,@alpha) 100%);     background: -ms-linear-gradient(top,  rgba(@r,@g, @b, .2) 0%,rgba(0,0,0,@alpha) 100%);     background: linear-gradient(to bottom,  rgba(@r,@g, @b, .2) 0%,rgba(0,0,0,@alpha) 100%); } 

setting color , alpha:

@rgbcolor: 221,73,50; @gradientalpha: 0.3; 

using it:

.wrapper .gradient { .gradient( @gradientalpha, @rgbcolor ); } 

returns:

syntaxerror: error evaluating function `rgba`: color functions take numbers parameters 

seems work fine until add alpha param. i've been scouring web 24hrs can't find explains why error creep up. can shed light on this?

much appreciated!

edit:

as per seven-phrases-max in comments, tried following:

.gradient(...) {     @color: extract(@arguments,1);     @alpha: extract(@arguments,2);      background: -moz-linear-gradient(top,  fade(@color, .2) 0%, color(0,0,0,@alpha) 100%);     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,fade(@color, .2)), color-stop(100%,fade(0,0,0,@alpha)));     background: -webkit-linear-gradient(top,  fade(@color, .2) 0%,fade(0,0,0,@alpha) 100%);     background: -o-linear-gradient(top,  fade(@color, .2) 0%,fade(0,0,0,@alpha) 100%);     background: -ms-linear-gradient(top,  fade(@color, .2) 0%,fade(0,0,0,@alpha) 100%);     background: linear-gradient(to bottom,  fade(@color, .2) 0%,fade(0,0,0,@alpha) 100%); }  @mycolor: 221,73,50; @gradientalpha: 30%;  .wrapper .gradient { .gradient(@mycolor, @gradientalpha); } 

but returns following error:

syntaxerror: error evaluating function `fade`: object #<object> has no method 'tohsl' 


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -