Re: [csswg-drafts] [scroll-animations-1] JS API for view-timeline-inset (#7748)

Good question, when providing CSSNumericValues the latter seems more obvious, but if we want to accept strings as well I think it's better to have one property so you can pass the computed value string from view-timeline-inset directly without having to split it as in my example above:

```
new ViewTimeline({
  subject: el,
  inset: getComputedStyle(subject).viewTimelineInset})
```

Whereas with startInset and endInset as separate properties you'd presumably have to split it like so:
```
const insets = getComputedStyle(subject).viewTimelineInset.split(' ');
new ViewTimeline({
  subject: el,
  startInset: insets[0],
  endInset: insets[1] || insets[0] /* Use first inset for endInset if no second inset supplied */
});
```



-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7748#issuecomment-1297441561 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 31 October 2022 17:38:49 UTC