w3c / w3c/csswg-drafts

[css-shapes] add additional corner-shapes options to inset() etc

Open
#8,946 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

css-shapes-2
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

https://drafts.csswg.org/css-shapes/#supported-basic-shapes

Currently inset(), xywh() and rect() allow an optional border-radius like syntax for rounding the corners of the rectangle. I'm proposing adding the other corner-shape options from https://drafts.csswg.org/css-backgrounds-4/#corner-shaping and their combination to this.

clip-path: inset(0 round 16px);
clip-path: inset(0 bevel 16px);
clip-path: inset(0 round bevel 16px);
clip-path: inset(0 round scoop 16px / 8px);

A common pattern to see for non-bordered angled corners right now is this:

clip-path: 
  polygon(
    16px 0, 
    calc(100% - 16px) 0, 
    100% 16px, 
    100% calc(100% - 16px), 
    calc(100% - 16px) 100%, 
    16px 100%, 
    0 calc(100% - 16px), 
    0 16px);

Which would get replaced with this:

clip-path: inset(0 bevel 16px);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the CSS Shapes supported basic shapes section and the CSS Backgrounds corner-shaping section linked in the issue. Compare the proposed inset(), xywh(), and rect() examples with the existing syntax and determine the required specification changes. Done means the additional corner-shape options and their combinations are defined consistently for these functions.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.