postcss-easing-gradients icon indicating copy to clipboard operation
postcss-easing-gradients copied to clipboard

Option to start or stop at different locations

Open JacobDB opened this issue 5 years ago • 2 comments

Sometimes I need to start a gradient at a point past 0% or stop it before 100%. Would it be possible to add support for this?

For example, a gradient such as:

linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.5) 25%, rgba(0, 0, 0, 0) 100%)

JacobDB avatar Aug 23 '19 21:08 JacobDB

I just ran in to this issue on another project; I'd still love to see this in a future update – @larsenwork have you had a chance to consider this feature?

JacobDB avatar Dec 23 '20 20:12 JacobDB

To adjust the starting point, the formula seems to be $location * (1 - ($start_point / 100)) + $start_point for each stop between 0% and 100% (excluding 0% and 100%)

JacobDB avatar Dec 23 '20 21:12 JacobDB