What I basically want to do
@gradientType: radial-gradient;
background: @gradientType(to bottom, ...)
I want to put a CSS Function, a gradient in this case (btw: are these called functions? I'm not sure) in a Less variable and call it later with the variable like @variable()?
Why? Maintainability!
I have a file variables.less where I want to change to gradient (ie) for a couple of places on the fly.
So instead of
.a { background: linear-gradient(..) }
.b { background: linear-gradient(..) }
.c { background: linear-gradient(..) }
I would have something like
.a { background: @myGradient(..) }
.b { background: @myGradient(..) }
.c { background: @myGradient(..) }
Linear gradients (linear-gradient(to bottom, red, blue)) and Radial gradients (radial-gradient(circle, red, blue)) kind of have the same syntax. So I would have four variables like gradientType, gradientOpts, gradientStart, gradientStop and change the gradient type based on the variable. This is just a simplified example.
linear-gradientfor aradial-gradient. The first param is different for the two.linear-gradient(to bottom, red, blue)andradial-gradient(circle, red blue)have kinda the same syntax. So I would have four variables likegradientType,gradientOpts,gradientStartandgradientStop. It's a simplified example