-
Notifications
You must be signed in to change notification settings - Fork 672
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-shapes-1] ellipse() grammar gratuitously inconsistent with radial-gradient() #824
Comments
There's an additional inconsistency that also applies to the Was there any reason for not allowing |
@AmeliaBR |
@astearns The reference box for sizing a clip-path or shape-outside doesn't need to be the margin-box. A circle sized to the content box's corners could still fit within the margin box. And the shape functions may be adopted for other uses. But regardless of the strength of use cases, I agree with Tab's original point that consistency is preferred. |
I should have addressed this a few years ago. Sorry for the delay. Adding the *-corner keywords should be fine. My guess is it's still possible to change the BUT I think we could change
Then there would be no breakage, no one would get a surprise trying to copy a radial gradient ellipse into an |
Hmm. If we allowed two keywords and both *-side and *-corner, then we'd have to define what it means when both keywords were *-corner. It's not immediately obvious to me what the resulting ellipse should be in those cases. |
Oh, that's a good point. And may have been the reason the radial-gradient syntax only allows one keyword. So the natural superset of the two syntaxes is one or two "side" keywords or lengths, or one "corner" keyword. Which is rather more confusing. |
I can assure you that's not why I wrote radial-gradient the way I did; I just happened to think of the ellipse/circle keywords as an automagical way to write the two sizes. |
Given that
|
I have a use-case! @keyframes circular-reveal {
from { clip-path: circle(0 at center); }
to { clip-path: circle(farthest-corner at center); }
} Right now this is only possible with JS. |
Agenda+ at @jakearchibald 's request |
The CSS Working Group just discussed
The full IRC log of that discussion<Rossen_> Topic: ellipse() grammar gratuitously inconsistent with radial-gradient()<Rossen_> github: https://github.com//issues/824 <bramus> Rossen_: last issue <bramus> astearns: i have one question about latest comment <bramus> astearns: jake his example is circle not ellipse <bramus> astearns: we also cover that? <bramus> TabAtkins: maybe? <bramus> astearns: does it use nearest/farthest corner? <bramus> TabAtkins: yes <bramus> astearns: so proposal would both cover circle and ellipse <bramus> astearns: looking through the issue <bramus> astearns: we want to change both circle and ellipse in basic shapes to match radial gradients <bramus> astearns: and i am fine with that <bramus> astearns: do we also want to retaint he facility that te basic ellipse function has <bramus> astearns: which is to define an ellipse that is as large as is possible for a given reference box <bramus> astearns: if we do this then there will be no breakage with current shape ellipses in use <bramus> astearns: but we would also wamt to add this to the gradient syntax <bramus> TabAtkins: yeah <bramus> astearns: fine going either way <bramus> Rossen_: lets pick one <bramus> astearns: do it all <lea> +1 <bramus> astearns: update the basic shape functions and update radial-gradient <bramus> Rossen_: opinions? <bramus> lea: yes, do it! <bramus> Rossen_: ojbections? <bramus> slicen <bramus> Rossen_: resolved <bramus> RESOLVE: update the basic shape functions and update radial-gradient <bramus> Rossen_: and that concludes the list of issues <dbaron> RESOLVED: update the basic shape functions and update radial-gradient |
Yay! |
Follow-up on the recent change. Is it intentional to not allow mixing an extent keyword and a length/percentage? That is,
What about a single size component value specified with From reading the normative value definition and the prose in CSS Images 3, a single While it would be confusing to allow eg. Note that it would mean that one of If you prefer to require two size component values with
|
Can you open a new issue on this followup, @cdoublev? |
The
ellipse()
grammar defined in Shapes was clearly designed to resemble the grammar of radial-gradient(), but it's different in small but important ways, for no apparent reason.In particular, the ellipse part of the
radial-gradient()
grammar is:<extent-keyword> | <length-percentage>{2}
. You either say something like "farthest-side", which defines an ellipse, or give lenpers for both axises.On the other hand, the
ellipse()
function says[ <extent-keyword> | <length-percentage> ]{2}?
- for each axis, you can either provide a keyword or a lenper. So you can do something likeellipse(farthest-side closest-side)
, to make its width the amount necessary to hit the farthest horizontal side, and its height the amount necessary to hit the closest vertical side. But you can't doellipse(closest-side)
.Given the seniority of the
radial-gradient()
syntax, and the lack of major issues with it, I think we should converge on that as the grammar forellipse()
.The text was updated successfully, but these errors were encountered: