Skip to content

Add support for Viewport Units #266

Open

Description

@Grumshow

On iOS Safari (iPhone 12 Pro Max) there is a bug where the animation timeline view block is incorrect, so the animation is at 100% briefly when it is coming into view.

You can see this happening at the bottom of the page on the demo page https://scroll-driven-animations.style/ if you slowly scroll down the page on iPhone.

I believe it's an incorrect number for VH being used, based on the address bar changing height to give more screen space.
Touched on with dvh etc here https://webkit.org/blog/12445/new-webkit-features-in-safari-15-4/

Strangely doesn't seem to be an issue on iPadOS, but the address bar is at the top rather than the bottom in that instance.

I'm using the non-module script tag version if that makes a difference.

Activity

  1. bramus commented on Oct 17, 2024

    @bramus
    Collaborator

    The polyfill current doesn’t support viewport units.

  2. added
    enhancement
    on Oct 17, 2024
  3. changed the title [-]iOS VH bug[/-] [+]Add support for Viewport Units[/+] on Oct 17, 2024
  4. rockinghelvetica commented on Dec 11, 2025

    @rockinghelvetica

    A workaround for missing VH units (which may not account for the DVH use case here) is that you can move the inset up to 50% as those percentage units are relative to the viewport, e.g. view-timeline-inset: 0% 50%; at which point something like entry 100% is saying that the bottom edge of the element hits the middle of the screen regardless of how tall it is.

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

  5. SalahAdDin commented on Dec 17, 2025

    @SalahAdDin

    A workaround for missing VH units (which may not account for the DVH use case here) is that you can move the inset up to 50% as those percentage units are relative to the viewport, e.g. view-timeline-inset: 0% 50%; at which point something like entry 100% is saying that the bottom edge of the element hits the middle of the screen regardless of how tall it is.

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

    Not working for me. The browser complains about an issue:

    Uncaught TypeError: Invalid time range or unsupported time range format.
        Tt proxy-animation.js:1019
        wt proxy-animation.js:1129
        At scroll-timeline-css.js:178
        At scroll-timeline-css.js:173
        At scroll-timeline-css.js:172
        <anonymous> index.js:32
        <anonymous> init-polyfill.js:69
    [proxy-animation.js:1019:13](https://flackr.github.io/scroll-timeline/src/proxy-animation.js)

    It is for animation-range: entry 0% entry 100%;.

  6. SalahAdDin commented on Dec 19, 2025

    @SalahAdDin

    Our solution: #304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions