Re: [csswg-drafts] [css-shapes-2][css-borders-4] Add a way to change an element's shape (#6997)

One proposal for `border-width` interaction. Writing 

Break it down in two steps.

Step 1. Assume a `width(t)` function that returns the width of the border parametrized over its length (`t=0` begin of the path,, `t=1` end of a continuous path). For each path, the `width(t)` function can be applied to create an outer shape by moving the path outside in the direction of the normal of the path.

Step 2. How to build `width(t)`. One option is to allow the user to specify a function or 1d gradient directly for each continuous path. But let's ignore that for now. Can we build a reasonable function given `border-width`? I think so. We can define "control points" (similar to what we have today): `0 - 0.25 - 0.5 - 0.75 - 1.0`. Each interval gets one width. And then we specify a transition range: so, something like: `width(t) = border-top-width [0.05, 0.2], lerp(top, right) [0.2, 0.3], right [0.3, 0.45] ... etc`. We can decide how much control/flexibility to give. This function would be applied to every continuous path on the shape.

Would something like this work?


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


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

Received on Wednesday, 29 January 2025 19:08:15 UTC