Skip to content

Commit 041d54b

Browse files
committed
Improve styles for smaller screens in schedule grid
1 parent 001c13d commit 041d54b

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function ScheduleSessionCard({
7979
// eslint-disable-next-line tailwindcss/no-contradicting-classname
8080
className={clsx(
8181
"[--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)]",
82-
"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",
82+
"group relative size-full p-4 font-normal no-underline ring-neu-400 @container focus-visible:z-[1] dark:ring-neu-100 [&:has(>a:hover)]:ring-1",
8383
blockTimeFraction < 1 && "[--bg:hsl(var(--color-neu-0)/50)]",
8484
)}
8585
style={
@@ -133,12 +133,12 @@ export function ScheduleSessionCard({
133133
)}
134134
<span className="mt-4 flex items-center gap-2 xl:mt-6">
135135
<span className="typography-body-xs flex items-center gap-0.5">
136-
<PinIcon className="size-4 text-pri-base" />
136+
<PinIcon className="size-4 text-pri-base [@container(width<240px)]:hidden" />
137137
{session.venue}
138138
</span>
139139
{blockTimeFraction < 1 && (
140140
<span className="typography-body-xs flex items-center gap-0.5">
141-
<ClockIcon className="size-4 text-pri-base" />
141+
<ClockIcon className="size-4 text-pri-base [@container(width<240px)]:hidden" />
142142
{Math.round(
143143
(new Date(session.event_end).getTime() -
144144
new Date(session.event_start).getTime()) /
@@ -151,7 +151,7 @@ export function ScheduleSessionCard({
151151
eventTitle={eventTitle}
152152
session={session}
153153
speakers={session.speakers || []}
154-
className="ml-auto"
154+
className="ml-auto [&_[data-text]]:hidden @[300px]:[&_[data-text]]:inline"
155155
/>
156156
</span>
157157
</span>
@@ -204,7 +204,9 @@ function AddToCalendarLink({
204204
)}
205205
>
206206
<CalendarIcon className="size-4 shrink-0 text-pri-base" />
207-
<span className="typography-body-xs">Add to calendar</span>
207+
<span data-text className="typography-body-xs">
208+
Add to calendar
209+
</span>
208210
</MenuButton>
209211
</div>
210212
<Transition

src/app/conf/_design-system/tag.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function Tag({ color, children, style, className, ...rest }: TagProps) {
77
return (
88
<span
99
className={clsx(
10-
"relative self-start whitespace-nowrap border px-2 py-1 font-mono text-xs/none uppercase dark:opacity-[96.5%]",
10+
"relative max-w-full self-start whitespace-nowrap border px-2 py-1 font-mono text-xs/none uppercase dark:opacity-[96.5%]",
1111
className,
1212
)}
1313
style={{ borderColor: color, ...style }}
@@ -19,7 +19,12 @@ export function Tag({ color, children, style, className, ...rest }: TagProps) {
1919
backgroundColor: color,
2020
}}
2121
/>
22-
<span className="relative flex items-center justify-center gap-2">
22+
<span
23+
className={clsx(
24+
"relative max-w-full items-center gap-2 overflow-hidden text-ellipsis",
25+
typeof children === "string" ? "block" : "flex",
26+
)}
27+
>
2328
{children}
2429
</span>
2530
</span>

tailwind.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Config } from "tailwindcss"
33
import typography from "@tailwindcss/typography"
44
import plugin from "tailwindcss/plugin"
55
import containerQueries from "@tailwindcss/container-queries"
6+
67
const config: Config = {
78
content: ["./src/**/*.{js,ts,jsx,tsx,mdx}", "./theme.config.tsx"],
89
theme: {

0 commit comments

Comments
 (0)