I made a multi-stop gradient mix-in that simply puts @arguments
for all the vendor prefixes for *-linear-gradient
. It works, put I'm annoyed when I define a gradient with many stops, I have to put everything on one line when using the mixin, like this:
.gradientMultiple(~'top, rgba(255, 255, 255, 1) 0%, rgba(254, 254, 254, 1) 16%, rgba(252, 252, 252, 1) 36%, rgba(239, 239, 239, 1) 66%, rgba(18, 34, 106, 1) 66%, rgba(13, 31, 136, 1) 84%');
I'd like to put the function parameter on multiple lines like this for readability, but it generates a parse error:
.gradientMultiple(~'top,
rgba(255, 255, 255, 1) 0%,
rgba(254, 254, 254, 1) 16%,
rgba(252, 252, 252, 1) 36%,
rgba(239, 239, 239, 1) 66%,
rgba(18, 34, 106, 1) 66%,
rgba(13, 31, 136, 1) 84%
');
Here's the mixin definition:
.gradientMultiple ( ... ) {
background-image: -webkit-linear-gradient(@arguments);
background-image: -moz-linear-gradient(@arguments);
background-image: -ms-linear-gradient(@arguments);
background-image: -o-linear-gradient(@arguments);
background-image: linear-gradient(@arguments);
}