Skip to content
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

[scroll-animations] Use CSSStyleValue for scroll offsets #4352

Closed
andruud opened this issue Sep 19, 2018 · 4 comments
Closed

[scroll-animations] Use CSSStyleValue for scroll offsets #4352

andruud opened this issue Sep 19, 2018 · 4 comments
Labels

Comments

@andruud
Copy link
Member

andruud commented Sep 19, 2018

Just a thought:

Perhaps it's appropriate to use CSSStyleValue from css-typed-om to get and set scroll offsets. It would allow specifying offsets in a "structured" manner, such as CSS.px(42) rather than "42px".

Specifically, this is how that could look:

// Set:

const timeline = new ScrollTimeline({
  // ...
  startScrollOffset: CSS.px(10),
  endScrollOffset: new CSSKeywordValue('auto')
  // ...
});

// Get:

console.log(timeline.startScrollOffset);
// -> CSSUnitValue {value: 10, unit: "px"}

console.log(timeline.endScrollOffset);
// -> CSSKeywordValue {value: "auto"}
@dontcallmedom dontcallmedom transferred this issue from WICG/scroll-animations Sep 19, 2019
@majido majido added the scroll-animations-1 Current Work label Sep 19, 2019
@tabatkins
Copy link
Member

If we do this, it would probably be good to remove support for supplying a string like "42px", that way we can infer that strings are keywords.

(The CSSKeywordish typedef that allowed for CSSKeywordValue or DOMString was removed from the spec for now, but I should add it back.)

@majido majido changed the title Use CSSStyleValue for scroll offsets [scroll-animations] Use CSSStyleValue for scroll offsets Oct 18, 2019
@flackr
Copy link
Contributor

flackr commented Aug 11, 2022

We've removed scroll offsets but we'll probably want to consider the same for whatever programmatic API we add to set view-timeline-inset.

@flackr
Copy link
Contributor

flackr commented Oct 7, 2022

Also relevant to #7575 and in particular how those values would be passed via JS, where I have already been leaning in this direction for the related API's: #7748, #7589

@flackr
Copy link
Contributor

flackr commented Nov 8, 2022

Closing this issue in favor of the specific issues linked relevant to the new APIs using offsets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants