-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
docs(fx112-css-ray): Create new page for ray() function #26266
Conversation
Preview URLs Flaws (1)Note! 1 document with no flaws that don't need to be listed. 🎉 URL:
External URLs (1)URL:
(comment last updated: 2023-04-20 03:57:06) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few comments. looking good. still working on the review.
files/en-us/web/css/ray/index.md
Outdated
|
||
{{CSSRef}} | ||
|
||
The **`ray()`** [CSS](/en-US/docs/Web/CSS) [function](/en-US/docs/Web/CSS/CSS_Functions) defines a line segment that begins from an [offset starting position](https://drafts.fxtf.org/motion/#offset-starting-position) and extends in the direction of the specified angle. The line segment is referred to as "ray". The length of a ray can be constrained by specifying a size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The **`ray()`** [CSS](/en-US/docs/Web/CSS) [function](/en-US/docs/Web/CSS/CSS_Functions) defines a line segment that begins from an [offset starting position](https://drafts.fxtf.org/motion/#offset-starting-position) and extends in the direction of the specified angle. The line segment is referred to as "ray". The length of a ray can be constrained by specifying a size. | |
The **`ray()`** [CSS](/en-US/docs/Web/CSS) [function](/en-US/docs/Web/CSS/CSS_Functions) defines a line segment that begins from a starting position set by {{CSSXref("offset-position")}} and extending in the direction of the specified angle. The line segment is referred to as "ray". The length of a ray can be constrained by specifying a size and the keyword `contain`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally left out linking to offset-position
page on MDN because the property is currently not supported on any browser (and therefore not used in any example) but the concept is supported in calculations. I took cue from the offset-position description that contains a link to spec's "initial position" definition to add a similar link here to a definition in the spec for the "offset starting position".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made some suggestions. Also forked your codepens. The first example doesn't work for me without size.
Thanks for the review @estelle and for your help with fixing the code.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🎉
The syntax for the
ray()
function (value in offset-path) has been updated in Fx112.<ray-size>
is now optional.<ray-size>
isclosest-side
.Changes in this PR
Updates the
ray()
function description in the existing offset-path page, adds links to some shape pagesAdds a new page for the
ray()
function. The webref is not updated with the new syntax so I have not included a "Formal syntax" section. I've added the syntax to the "Syntax" section for now.Spec: https://drafts.fxtf.org/motion/#ray-function
Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1820071
Support in browsers
ray()
is available behind the flaglayout.css.motion-path-ray.enabled
.offset-path: ray()
functionality is available with "Experimental Web Platform features" enabled but the syntax implementation is not in sync with the latest spec. The BCD table on offset-path page contains a row onray()
that indicates complete support, which is contrary to what I saw in testing.Codepens
Codepens for the examples used in the doc can be found here (tested in Firefox behind the flag):
Example 1: https://codepen.io/dipikabh/pen/yLReQaZ
Example 2: https://codepen.io/dipikabh/pen/PoyNQdz
Caveat
The functionality is still undergoing discussions:
contain
keyword behavior is due to be fixed in Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1821450) as a result of [motion-1] the description of contain flag in ray() function w3c/fxtf-drafts#363.To Do
Related issues
Doc issue tracker: #25358