Skip to content

Instantly share code, notes, and snippets.

@brookback
Created November 15, 2024 12:35
Show Gist options
  • Save brookback/69cc4b7d947ba11a4220b26c4eff6efd to your computer and use it in GitHub Desktop.
Save brookback/69cc4b7d947ba11a4220b26c4eff6efd to your computer and use it in GitHub Desktop.
td:first-child {
position: sticky;
left: 0;
z-index: 1;
animation-name: frozen;
animation-duration: 1ms; /* Firefox needs this. */
animation-direction: alternate;
animation-timeline: scroll(inline nearest);
/* Hide shadow in all directions except east. */
clip-path: inset(0 -30px 0 0); /* 30px is matching the box shadow size. */
}
@keyframes frozen {
from {
box-shadow: none;
}
1%,
100% {
background-color: white;
}
to {
box-shadow: rgb(0 0 0 / 10%) 10px 0 30px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment