-
Notifications
You must be signed in to change notification settings - Fork 756
[scroll-animations] Add css syntax for element-based offset #5264
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
Conversation
|
@tabatkins I appreciate if you could review. I particular I like to make sure the function design is correct and provides good ergonomics. |
|
/cc @andruud to be aware of the upcoming css syntax. |
|
Why not just: |
|
@andruud I like that idea. I went ahead and did it that way. Would you mind doing a review? Removing Tab as reviewer since we no longer are using a function. |
andruud
left a comment
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.
lgtm
scroll-animations-1/Overview.bs
Outdated
|
|
||
| <pre> | ||
| <dfn><scroll-timeline-offset></dfn> = auto | <<length-percentage>> | <<element-offset>> | ||
| <dfn><element-offset></dfn> = selector(<<id-selector>>) [<<element-offset-edge>> || <<number>>]? |
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.
This is totally my bad, since my suggestion had the same mistake, but we normally want function( <foo> ) rather than function(<foo>). See the math function syntax for reference.
The 'source' descriptor has the same issue, by the way.
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.
Good catch. I fixed the syntax for selector.
44085cd to
baaef61
Compare
Add css syntax to for element-based offsets. Fixes #4337.
The element-based syntax is simply applied when the value starts with
selector(#id)with the following characteristics:<<id-selector>>is required and is expected to be the first value.I followed some of the ideas mentioned by @tabatkins in #4348 to to get to a more ergonomic css function syntax. In particular there is no comma and the optional params can be in any order. Note that unlike #4348 we are not adding a function syntax.