If you are familiar with less, could you help me with this problem? I am creating a radial gradient mixin for just a quick test case. However both are not working?
.radialGradient(@posX:center @posY:center, @shape:circle @size:closest-side, @from:white, @to:black){
background-image: -webkit-radial-gradient(@arguments);
}
or
.radialGradient(@posX:center @posY:center, @s开发者_如何学运维hape:circle @size:closest-side, @from:white, @to:black){
background-image: -webkit-radial-gradient(@posX @posY, @shape @size, @from, @to);
}
Reasons?
Thanks!
Ah! I figured out. I have forgotten to add in "," in the parameters.
.radialGradient(@posX:center, @posY:center, @shape:circle, @size:closest-side, @from:white, @to:black){
background-image: -webkit-radial-gradient(@posX @posY, @shape @size, @from, @to);
}
This is the right way.
They changed LESS PHP to match LESS JS in regards to parameter syntax. Values used to be separated by ; now they are separated by ,
Ah, I've discovered the solution. You forgot to add a comma after your first parameter ;P
.radialGradient(@posX:center, @posY:center, @shape:circle, @size:closest-side, @from:white, @to:black){
background-image: -webkit-radial-gradient(@posX @posY, @shape @size, @from, @to);
}
精彩评论