Re: [csswg-drafts] [css-backgrounds] The shape of box-shadow should be a circle for a box with border-radius:50% and big spread (#7103)

I guess what could work is:

1. Calculate the radius of the border corners in percentages or the border box size
2. Set the radius of the shadow corners to be the same percentages, but now resolved with the shadow size.

Or in other words,

1. Resolve the radius of the border corners as a pair of lengths `x / y`.
2. Let the sizes of the border box be `b_x` and `b_y`
3. Let the sizes of the shadow box be `s_x` and `s_y`
4. Set the radius of the corresponding corner of the shadow box to `calc(x * s_x / b_x) / calc(y * s_y / b_y)`, or to 0px to avoid dividing by zero.

So if you have the initial `border-radius: 0px` (i.e. 0%), then the shadow will keep being sharp with `0px`.

And if you have `border-radius: 50%` then the shadow will keep being a full circle/ellipsis with `50%` of its size.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7103#issuecomment-1135036126 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 23 May 2022 19:04:20 UTC