fix(ui): fade the hidden edges of horizontally scrolling tab rows

This commit is contained in:
sam committed 2026-10-18 23:45:28 +11:00
1 parent 06014f4a39
commit e5520ae4e5
2 files changed
+37 -1

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ watch(activePath, revealActive, { flush: "post" });
<nav
ref="root"
aria-label="Sections"
class="flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]"
class="scroll-fade-x flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]"
>
<RouterLink
v-for="entry in links"
+36
View File
@@ -94,3 +94,39 @@
display: none;
}
}
/* Fades whichever edge of a horizontal scroller still hides content. */
@property --fade-start {
syntax: "<length>";
inherits: false;
initial-value: 0px;
}
@property --fade-end {
syntax: "<length>";
inherits: false;
initial-value: 1.5rem;
}
@keyframes scroll-fade-x {
0% {
--fade-start: 0px;
}
10%,
90% {
--fade-start: 1.5rem;
--fade-end: 1.5rem;
}
100% {
--fade-end: 0px;
}
}
@utility scroll-fade-x {
mask-image: linear-gradient(
to right,
transparent,
#000 var(--fade-start),
#000 calc(100% - var(--fade-end)),
transparent
);
animation: scroll-fade-x linear both;
animation-timeline: scroll(self inline);
}