Skip to content

Commit 71c219d

Browse files
committed
fix: dark mode and glassmorphism theme in Tailwind v4
- Add @custom-variant dark for proper dark mode support in Tailwind v4 - Create CSS classes for theme backgrounds (theme-neo-*, theme-glass-*) - Fix ThemeWrapper to use CSS classes instead of inline gradient syntax - Fix Groups page card styling for dark/light mode in both themes
1 parent c330e57 commit 71c219d

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

web/components/layout/ThemeWrapper.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export const ThemeWrapper = ({ children }: { children: React.ReactNode }) => {
88
let bgClass = "";
99

1010
if (style === THEMES.NEOBRUTALISM) {
11-
bgClass = mode === 'dark' ? 'bg-[#1a1a1a] text-white' : 'bg-[#fffdf5] text-black'; // Off-yellowish white for Neo Light
11+
bgClass = mode === 'dark' ? 'theme-neo-dark text-white' : 'theme-neo-light text-black';
1212
} else {
1313
// Glassmorphism - Vibrant gradients
1414
bgClass = mode === 'dark'
15-
? 'bg-[radial-gradient(ellipse_at_top_right,_var(--tw-gradient-stops))] from-indigo-900 via-slate-900 to-black text-white'
16-
: 'bg-[radial-gradient(ellipse_at_top_right,_var(--tw-gradient-stops))] from-indigo-200 via-purple-100 to-white text-gray-900';
15+
? 'theme-glass-dark text-white'
16+
: 'theme-glass-light text-gray-900';
1717
}
1818

1919
return (

web/pages/Groups.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ export const Groups = () => {
125125
onClick={() => navigate(`/groups/${group._id}`)}
126126
className={`group cursor-pointer transition-all duration-300 relative overflow-hidden flex flex-col h-full
127127
${style === THEMES.NEOBRUTALISM
128-
? 'border-2 border-black bg-white shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hover:shadow-[6px_6px_0px_0px_rgba(0,0,0,1)]'
129-
: 'rounded-2xl border border-white/10 bg-white/5 backdrop-blur-md hover:bg-white/10 shadow-lg'}
128+
? `border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hover:shadow-[6px_6px_0px_0px_rgba(0,0,0,1)] ${mode === 'dark' ? 'bg-zinc-800' : 'bg-white'}`
129+
: `rounded-2xl border shadow-lg backdrop-blur-md ${mode === 'dark' ? 'border-white/20 bg-white/10 hover:bg-white/15' : 'border-black/10 bg-white/60 hover:bg-white/80'}`}
130130
`}
131131
>
132132
<div className={`h-24 w-full flex items-center px-6 relative overflow-hidden ${style === THEMES.NEOBRUTALISM ? 'bg-neo-main border-b-2 border-black' : 'bg-gradient-to-r from-blue-500/20 to-purple-500/20'}`}>

web/src/index.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@import "tailwindcss";
22

3+
@custom-variant dark (&:where(.dark, .dark *));
4+
35
@theme {
46
--font-sans: 'Inter', sans-serif;
57
--font-mono: 'Space Grotesk', monospace;
@@ -11,6 +13,23 @@
1113
--color-neo-dark: #1a1a1a;
1214
}
1315

16+
/* Theme backgrounds */
17+
.theme-neo-light {
18+
background-color: #fffdf5;
19+
}
20+
21+
.theme-neo-dark {
22+
background-color: #1a1a1a;
23+
}
24+
25+
.theme-glass-light {
26+
background: radial-gradient(ellipse at top right, #c7d2fe, #e9d5ff, #ffffff);
27+
}
28+
29+
.theme-glass-dark {
30+
background: radial-gradient(ellipse at top right, #312e81, #0f172a, #000000);
31+
}
32+
1433
/* Scrollbar hiding for cleaner UI */
1534
.no-scrollbar::-webkit-scrollbar {
1635
display: none;

0 commit comments

Comments
 (0)