Skip to content

Commit 0e636ea

Browse files
committed
Show a gradient in schedule cards if the talk is shorter than block
1 parent f1c8b74 commit 0e636ea

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/app/conf/2025/schedule/_components/schedule-session-card.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,23 @@ export function ScheduleSessionCard({
6464
{eventTitle}
6565
</div>
6666
) : (
67-
<div className="group relative size-full bg-neu-0 p-4 font-normal no-underline ring-neu-400 focus-visible:z-[1] dark:ring-neu-100 dark:hover:bg-neu-0/80 [&:has(>a:hover)]:bg-neu-0/90 [&:has(>a:hover)]:ring-1">
67+
<div
68+
// eslint-disable-next-line tailwindcss/no-contradicting-classname
69+
className={clsx(
70+
"[--bg:hsl(var(--color-neu-0))] [&:has(>a:hover)]:[--bg:hsl(var(--color-neu-0)/.9)] dark:[&:has(>a:hover)]:[--bg:hsl(var(--color-neu-0)/.8)]",
71+
"group relative size-full p-4 font-normal no-underline ring-neu-400 focus-visible:z-[1] dark:ring-neu-100 [&:has(>a:hover)]:ring-1",
72+
blockTimeFraction < 1 && "[--bg:hsl(var(--color-neu-0)/50)]",
73+
)}
74+
style={
75+
{
76+
"--time": `${blockTimeFraction * 100}%`,
77+
background:
78+
blockTimeFraction < 1
79+
? `linear-gradient(to bottom, var(--bg), var(--bg) var(--time), hsl(var(--color-neu-0)/.8) var(--time), hsl(var(--color-neu-0)/.8))`
80+
: "var(--bg)",
81+
} as {}
82+
}
83+
>
6884
<Anchor
6985
id={`session-${session.id}`}
7086
href={`/conf/${year}/schedule/${session.id}?name=${session.name}`}
@@ -146,7 +162,7 @@ function AddToCalendarLink({
146162
return (
147163
<a
148164
className={clsx(
149-
"relative z-[2] -m-1 flex gap-0.5 p-1 ring-neu-100 hover:bg-neu-50/50 hover:ring-1",
165+
"relative z-[2] -m-1 flex gap-0.5 p-1 ring-neu-400 hover:bg-neu-50/50 hover:ring-1 dark:ring-neu-100",
150166
className,
151167
)}
152168
href={ics({

0 commit comments

Comments
 (0)