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

exit-crossing with a px value not working consistently #290

Open
callie-openai opened this issue Oct 18, 2024 · 0 comments
Open

exit-crossing with a px value not working consistently #290

callie-openai opened this issue Oct 18, 2024 · 0 comments

Comments

@callie-openai
Copy link

callie-openai commented Oct 18, 2024

I have a position: sticky type of interface I'm building with this. It's relatively simple but I want to clip the contents of the non-sticky container when it goes past a threshold on the exit-crossing bounds.

// title or target height is 32px
animation: clip-out linear both;
animation-timeline: view(block);
// animation-range: exit-crossing -64px exit-crossing 32px;
animation-range: exit-crossing -64px exit-crossing calc(-64px + 100%);

I use simple markup like the following tailwind-esque to create a little playground:

<h3 className={clsx(styles.cardHeader, styles.cardHeaderAnimation)}>
  Yesterday
</h3>
<ul className={clsx(styles.cardContents, styles.cardContentsAnimation)}>
  <li>Conversation 1</li>
  <li>Conversation 2</li>
  <li>Conversation 3</li>
</ul>
<h3 className={clsx(styles.cardHeader, styles.cardHeaderAnimation)}>
  Previous 7 days
</h3>
<ul className={clsx(styles.cardContents, styles.cardContentsAnimation)}>
  <li>Conversation 1</li>
  <li>Conversation 2</li>
  <li>Conversation 3</li>
</ul>
<h3 className={clsx(styles.cardHeader, styles.cardHeaderAnimation)}>
  Previous 30 days
</h3>
<ul className={clsx(styles.cardContents, styles.cardContentsAnimation)}>
  <li>Conversation 1</li>
  <li>Conversation 2</li>
  <li>Conversation 3</li>
</ul>
<h3 className="sticky top-[32px] my-2">Previous 90 days</h3>
<ul className={clsx(styles.cardContents, styles.cardContentsAnimation)}>
  <li>Conversation 1</li>
  <li>Conversation 2</li>
  <li>Conversation 3</li>
</ul>

This works flawlessly in Chrome, but in Safari it clips it way too early and incorrectly. I'm assuming this might be due to position: sticky?

Safari Example

Screen.Recording.2024-10-18.at.4.55.37.PM.mov
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