Re: [csswg-drafts] [css-masking] Suggestion: Specify clipPathUnits for CSS clip-path: path (#5618)

> > I think this is solved differently now with https://drafts.csswg.org/css-shapes-2/#shape-function
> 
> [@noamr](https://github.com/noamr) Can you describe how `shape()` does this? I don't see some description or example in the specification.
> 
> This is a problem that has plagued many CSS authors for a long time.
> 
> * https://jamesmcgrath.net/scaling-svg-clippath/
> * https://css-tricks.com/unfortunately-clip-path-path-is-still-a-no-go/
> * https://stackoverflow.com/questions/29495919/how-to-apply-clippath-to-a-div-with-the-clippath-position-being-relative-to-the
> * https://stackoverflow.com/questions/31210466/convert-svg-path-data-to-0-1-range-to-use-as-clippath-with-objectboundingbox
> * https://stackoverflow.com/questions/53618192/create-responsive-svg-clip-path-making-svg-path-responsive

`shape()` is exactly a responsive `path()`, where you can specify length/percentage for each point.
You're right that we need more examples in the spec! I will add some. Stay tuned!

In the meantime you can refer to the tests for examples: https://github.com/web-platform-tests/wpt/blob/9726c469a36bdbb1f420c170cd28493fe4442eb1/css/css-masking/parsing/clip-path-shape-parsing.html#L14

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


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

Received on Tuesday, 14 January 2025 18:10:33 UTC