Re: [csswg-drafts] [css-shapes-2] corner-shape support for superellipsis (#10993)

Just as a thought, perhaps in addition to a squircle-specific thing, we can allow cartesian functions in shapes, and then superellipses can be expressed using custom functions, and we can perhaps ship some built-in stock custom functions?

```css
@function --superellipse(--rx, --ry, --n, --x) {
  result: calc(var(--ry) * pow(1 - pow( x / var(--rx), var(--n)), 1 / var(--n)));
}

@function --squircle-arc(--x) {
    result: --superellipse(50%, 50%, 3, --x);
}

.squircle {
    clip-path: shape(from 50% 0,
        plot --squircle-arc to 100% 50%,
        plot --squircle-arc to 50% 100%,
        plot --squircle-arc to 0 50%,
        plot --squircle-arc to 50% 0
    );
}
```

This way if someone wants a "slightly different" arc we don't have to convene again to decide on specifics :)

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


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

Received on Thursday, 5 December 2024 15:04:19 UTC