I have a black background and you want to add a block inside with a simple CSS gradient from transparent to 0.7 white:
linear-gradient(to right, hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0.76) 14%, hsla(0, 0%, 100%, 0.76) )
But it looks bad:
The only way I found is to add additional color stops manually.
background: linear-gradient( to right, hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0.05) 2%, hsla(0, 0%, 100%, 0.09) 3%, hsla(0, 0%, 100%, 0.2) 5%, hsla(0, 0%, 100%, 0.57) 11.5%, hsla(0, 0%, 100%, 0.69) 14%, hsla(0, 0%, 100%, 0.75) 16.5%, hsla(0, 0%, 100%, 0.76) 17.5%, hsla(0, 0%, 100%, 0.77) );
And it looks much better:
CodePen Demonstration
Is there an easier way to make the CSS gradient smoother when the color stops?