[scroll-animations] Add css syntax for element-based offset #5264
Merged
Conversation
Contributor
Author
|
@tabatkins I appreciate if you could review. I particular I like to make sure the function design is correct and provides good ergonomics. |
Contributor
Author
|
/cc @andruud to be aware of the upcoming css syntax. |
Member
|
Why not just: |
Contributor
Author
|
@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
approved these changes
Jun 29, 2020
|
|
||
| <pre> | ||
| <dfn><scroll-timeline-offset></dfn> = auto | <<length-percentage>> | <<element-offset>> | ||
| <dfn><element-offset></dfn> = selector(<<id-selector>>) [<<element-offset-edge>> || <<number>>]? |
Member
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
Good catch. I fixed the syntax for selector.
44085cd to
baaef61
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.