Because a CSS gradient is treated as an image, you can use a gradient to generate a shape by having transparent or semi-transparent areas as part of the gradient.
The next example uses generated content. The content has been floated, giving it a background image of a linear gradient. I am using that same value as the value of shape-outside
. The linear gradient goes from purple to transparent. By changing the value of shape-image-threshold
, you can decide how transparent the pixels need to be that create the shape. You can play with that value in the example below to see how the diagonal line will move across the shape depending on that value.
You could also try removing the background image completely, thus using the gradient purely to create the shape and not displaying it on the page at all.
The next example uses a radial gradient with an ellipse, once again using a transparent part of the gradient to create the shape.
You can experiment directly in these live examples to see how changing the gradient will change the path of your shape.