Re: [csswg-drafts] [css-borders-4] Interaction of single-path `border-shape` with non-uniform `border-width` (#11662)

@smfr I improved it to work well for bezier curves (see demo).
It works as follows:

1. Divide the path into closed subpaths
2. divide each closed subpath into segments
3. If counter-clockwise, reverse
4. For each segment:
   4.1. Choose the stroke width and color by which border is to the left of the vector created by the segment.
          e.g. a segment that points to the right would receive the top border.
   4.2. create the inner and outer outline paths for the segment. For a bezier, this could become several beziers
   4.3 Extend/trim the first/last point in each outline linearly to intersect with the adjoining first/last segment.
         For beziers, the segment is the tangent at the start/end (which is the straight line to the control point).
   4.4 fill the quad between the inner and outer outlines
 
We can achieve something like a color per inner curve if we split each bezier curve at the extrema at the beginning of 4, but I didn

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


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

Received on Tuesday, 11 February 2025 16:12:29 UTC