Skip to content
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

[css-borders] Add shorthand for border-shape / corner-shape / border-radius #11679

Open
nt1m opened this issue Feb 9, 2025 · 2 comments
Open

Comments

@nt1m
Copy link
Member

nt1m commented Feb 9, 2025

The shorthand could be like this:

border-shape: <border-shape-path> | [ <corner-shape> || <border-radius> ] (syntax tbd, including to control the 4 corners )

You'd be able to specify things like this:

border-shape: bevel 30px

border-shape: squircle 30px

cc @noamr @SebastianZ @LeaVerou @fantasai @bert-github

@noamr
Copy link
Collaborator

noamr commented Feb 9, 2025

Isn't this identical to inset(0 squircle 50%) etc? perhaps it makes more sense as a basic-shape shorthand than something specific to border-shape?

Having a shorthand raises the question of how a border-shape: round 20% is prioritized alongside border-radius: 30% etc. Usually a longhand has higher priority than a shorthand, but border-shape has higher priority than border-radius. So perhaps allowing inset or rect to not provide coordinates would be cleaner? like border-shape: inset(squircle) or bordrer-shape: inset(bevel 30%)

@nt1m
Copy link
Member Author

nt1m commented Feb 9, 2025

Sorry, I wasn't clear in my proposal. border-shape would become the shorthand, and then the existing border-shape would become border-shape-path or something, which would be a longhand of border-shape.

Given corner-shape and border-radius go hand in hand, we should be able to set them together from one shorthand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants