-
Notifications
You must be signed in to change notification settings - Fork 711
[css-masking] Find a way for clip-path to play nicely with borders and filters #5881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Something that creates an inner stroke by default to match the border behavior. Would also need the options to match |
Though note that this is not just about stroke - also about clipping behavior of filters. |
What about a The default value would then define the current behavior and a second one the behavior @noamr describes. Having this as a separate property allows to change or animate the path without having to re-define the clipping behavior. (And with that, maybe Sebastian |
I like the idea, though maybe I would bikeshed about a word other than type which tends to be overused (masking-behavior?) Anyway I'd love to see how to advance this. @tabatkins any thoughts? Should I try to get this into a CSSWG call agenda? |
I don't really think giving I find the idea of using a property called |
It would still clip the contents but not the border/effects. So it's still a clip, albeit partial. |
Yeah, but I think that’s a mistake in its original property name. Imagine it was just called |
I think part of this came from the fact that |
Yes,
This idea is growing on me. Here are my thoughts on how that could work: Border-path
|
Namely, a CSS shape.
Interesting, I like the direction. I originally thought you'd need to use CSS variables for them to be the same. I wonder though, why could border-path be a reference value, and not shape-outside or clip-path? (i.e.. why I also wonder how it should interact with |
Yes, but including The CR of Shapes is here: https://www.w3.org/TR/css-shapes/#typedef-basic-shape and it could use https://www.w3.org/TR/css-masking-1/#typedef-clip-source
It just felt like For
I’d say it mostly shouldn’t. You either use the box and it’s sides and (possibly rounded) corners for the shape, or you create some other shape. Suppose you have |
Thanks, this explains it.
OK, I get how it would behave in those simple cases, but what would be the behavior if you have both a complex path and a border radius? |
@bradkemper: either way, I'm happy to continue pushing this and flesh out the details. How do we go about this? |
border-path: padding-box inset(12px) ;
border-radius: 30px; would really never need to be a thing. I've also suggested in other threads that |
See also #6997 |
I think #6997 is closer to what we want than this. Something like |
Currently, clip-path has a lot of great options. However, it has two limitations:
It would be great if there was a shape-based option that behaved like border-radius:
overflow: hidden
, but not its own filtersMaybe a new property
border-path
(betweenborder-radius
andclip-path
)?Maybe an additional parameter to
clip-path
?The text was updated successfully, but these errors were encountered: