Skip to content

Commit e5159f4

Browse files
committed
misc(whats-happening): aesthetic tweak and fix potential tailwindcss bug
tailwindcss analyzes className rules statically, without executing the javascript code. it then generates the final optimized css file. if tailwindcss cannot detect such classes, e.g. "max-w-2xl" elsewhere in the codebase, the final css file will not have the corresponding ruleset. documentation reference: https://tailwindcss.com/docs/detecting-classes-in-source-files#dynamic-class-names
1 parent 8318e0c commit e5159f4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/sections/whats-happening.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ export function WhatsHappening({ events }: { events: WhatsHappeningEvent[] }) {
1515
return (
1616
<section className="container mx-auto">
1717
<h2 className="mb-8 text-center text-3xl font-bold">What's Happening</h2>
18-
<div className={cn("grid gap-8", "md:grid-cols-" + Math.min(events.length, 3))}>
18+
<div
19+
className={cn(
20+
"mx-auto grid gap-8",
21+
["md:grid-cols-1", "md:grid-cols-2", "md:grid-cols-3"][Math.min(events.length, 3) - 1],
22+
["max-w-2xl", "max-w-4xl", "max-w-6xl"][Math.min(events.length, 3) - 1]
23+
)}
24+
>
1925
{events.map((event, index) => (
2026
<Card
2127
key={index}

0 commit comments

Comments
 (0)