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

timeline-scope on body failing #255

Open
rockinghelvetica opened this issue Mar 21, 2024 · 1 comment
Open

timeline-scope on body failing #255

rockinghelvetica opened this issue Mar 21, 2024 · 1 comment

Comments

@rockinghelvetica
Copy link

I am truly excited about this API/polyfill, because it allows for unitless values to be connected by CSS to VW units and ilk. I've been casually hacking at this goal across a decade, so first of all: thank you!

Here is a prototype connecting a utility DIV with a view-timeline that drives a variable font axis as the browser window is resized between 768px and 1400px. This was not possible before without JS.

Debug view: https://cdpn.io/pen/debug/mdgWBdE
Source: https://codepen.io/rockinghelvetica/pen/mdgWBdE

It works in Chromium, but the polyfill does not seem to work in this scenario. I suspect it's the nuance of hoisting the timeline scope:

body {
  timeline-scope: --viewDriver;
}

There's some commented-out code in the demo that connects the view timeline to the instrument — a more default scope — and that functions as expected with the Polyfill. I also tried applying a basic opacity animation to the headline in case it was related to parsing the font animation, to no avail.

Am I bungling something, or is there a gap in coverage with timeline-scope here?

@rockinghelvetica
Copy link
Author

Another example, where this API is standing in for an impossible CSS calc() of a negative animation-duration value:

https://codepen.io/rockinghelvetica/pen/KKYWojM

A more direct approach using CSS math might catch up soon enough in browsers, but you're first AFAIK.

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

No branches or pull requests

1 participant