csswg-drafts icon indicating copy to clipboard operation
csswg-drafts copied to clipboard

background-clip has not kept up with element clip styles. Needs to be able to accept polygon, rect etc

Open ExtAnimal opened this issue 1 year ago • 1 comments

It should be possible to use

background-clip : polygon(0 0, 100% 0, 100% calc(100% - var(--footer-height)), 0 calc(100% - var(--footer-height)));

Ans all other clip-path shapes.

ExtAnimal avatar Sep 29 '25 13:09 ExtAnimal

This was previously proposed (https://github.com/w3c/csswg-drafts/issues/3140), but the conversation never started.

It's a niche design need, but I would have assumed I could already do this if I hadn't been reading otherwise for the last few minutes. It fits nicely with how clip-path and offset-path - though the naming of both of those makes me wonder if this should be background-path instead.

The naming of these isn't totally consistent. Both background-clip and mask-clip lack shape features, but work with the content/margin/padding box (etc.) instead. But clip-path and offset-path can do both at the same time.

JoshuaLindquist avatar Sep 29 '25 16:09 JoshuaLindquist