-
Notifications
You must be signed in to change notification settings - Fork 693
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] border-radius
with a circular edge
#6467
Comments
Just a minor note:
Points to the wrong url (same as Tailwind's). |
YES |
Maybe |
could use |
Thank you, @nickfla1-mxm! The link has now been updated. |
As much as I would love to see this, is there any concern that the term round or something similar could be confusing? Perhaps something more like "circular" would be more descriptive? Generally any radius is making a corner round to some degree, but "circular" may better indicate that it is meant to be fully rounded? |
This has indeed troubled developers for many years, and using |
While I don’t want the request for a semantic value to get confused with bikeshedding a specific keyword solution, I hope it will be helpful to share something I’ve learned. Having reviewed the specification for Here is an example of using a {
border-radius: .3em .8em .8em .3em / .3em 50% 50% .3em;
corner-shape: round angle angle round;
padding: .5em 1em .5em .5em;
} I think it would be confusing to write |
Since a circular border is a the result of a radius that is as large as possible, maybe the optimal keyword for this would be one that describes exactly that. {
border-radius: maximum;
} |
Adding separate keyword for the corner shape (like |
CSS Values spec:
https://drafts.csswg.org/css-values-4/#calc-error-constants I think this means that If this is true, the next step would be to find/create the browser bugs and get this implemented. CC @Afif13 |
@simevidas You can't use |
@Loirooriol it seems that "infinity" is only allowed within a calculation. |
Yeah, bad example, |
all this talk of infinity, I think, is leaning into the hack. This pill shape is created on a horizontal element (lets say https://codepen.io/jsnkuhn/pen/ZErOqwL This creates a situation where the reference circles for the top and bottom corners are fully overlapping. (Note that this is also how we get a circle with It needs to be a equal value so that the radius reference is round. If you would do The problem comes in when the width and the height values are not fixed. So 9999px works because:
So is what's needed here some sort of element unit? As in border-radius: 50eh; eh = element height Also of note: This has implications for |
for the record these are the so hopefully crystal clear why a a live codepen of these with my corner-shape worklet (chrome only for now). FYI haven't clamped the corner-size values yet so 9999999px isn't going to work as expected. |
border-radius
with a circular edge
Note that we already have Sebastian |
Is there, or could there be a more semantic way to describe a border radius as being round rather than some current conventions?
From TailwindCSS:
From an accepted StackOverflow answer:
Other examples include
9999em
or100vmax
.Perhaps we could introduce a keyword, like
round
?The text was updated successfully, but these errors were encountered: