Skip to content

Commit b46c4e7

Browse files
ajitpratap0Ajit Pratap Singhclaude
authored
fix(website): comprehensive light mode CSS fixes for Tailwind v4 (#515)
The light mode was broken because Tailwind v4 compiles utilities inside @layer which wins the CSS cascade over unlayered selectors, and many classes use arbitrary values (bg-[#09090b]) or slash-encoded opacities (bg-white/[0.06]) that attribute selectors can't match. Fixes: - Add !important to all html.light overrides for Tailwind v4 cascade - Add direct class selectors for bg-white/[0.06], bg-white/5, etc. - Add bg-[#09090b] override for playground root container - Add bg-slate-900/50, bg-slate-900/30 etc. direct overrides - Add border-white/[0.06], border-white/10 etc. direct overrides - Darken slate text overrides for better playground contrast - Override all select elements for light mode - Add playground-specific overrides (blue tabs, emerald code, dividers) - Keep green parser dot, loading skeletons, hover states correct Co-authored-by: Ajit Pratap Singh <ajitpratapsingh@Ajits-Mac-mini-2655.local> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 463ea0a commit b46c4e7

File tree

1 file changed

+83
-20
lines changed

1 file changed

+83
-20
lines changed

website/src/app/globals.css

Lines changed: 83 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ html.light .text-zinc-600 { color: #4B5563 !important; }
156156
html.light .text-indigo-300 { color: #4338CA !important; }
157157
html.light .text-emerald-400 { color: #059669 !important; }
158158
/* Slate palette (used in playground components) */
159-
html.light .text-slate-200 { color: #374151 !important; }
160-
html.light .text-slate-300 { color: #4B5563 !important; }
161-
html.light .text-slate-400 { color: #4B5563 !important; }
162-
html.light .text-slate-500 { color: #6B7280 !important; }
163-
html.light .text-slate-600 { color: #4B5563 !important; }
159+
html.light .text-slate-200 { color: #1E293B !important; }
160+
html.light .text-slate-300 { color: #334155 !important; }
161+
html.light .text-slate-400 { color: #475569 !important; }
162+
html.light .text-slate-500 { color: #475569 !important; }
163+
html.light .text-slate-600 { color: #334155 !important; }
164164

165165
/* --- Heading gradient: dark gradient on light bg --- */
166166
html.light .from-white { --tw-gradient-from: #0F172A !important; }
@@ -180,6 +180,12 @@ html.light .glass-hover:hover {
180180
}
181181

182182
/* --- Borders (white/opacity → black/opacity) --- */
183+
html.light .border-white\/\[0\.06\] { border-color: rgba(0, 0, 0, 0.08) !important; }
184+
html.light .border-white\/\[0\.08\] { border-color: rgba(0, 0, 0, 0.08) !important; }
185+
html.light .border-white\/\[0\.1\] { border-color: rgba(0, 0, 0, 0.12) !important; }
186+
html.light .border-white\/\[0\.12\] { border-color: rgba(0, 0, 0, 0.12) !important; }
187+
html.light .border-white\/5 { border-color: rgba(0, 0, 0, 0.06) !important; }
188+
html.light .border-white\/10 { border-color: rgba(0, 0, 0, 0.10) !important; }
183189
html.light [class*="border-white\\/"] { border-color: rgba(0, 0, 0, 0.10) !important; }
184190
html.light [class*="divide-white\\/"] { border-color: rgba(0, 0, 0, 0.08) !important; }
185191

@@ -197,19 +203,30 @@ html.light .bg-surface { background-color: #FFFFFF !important; }
197203
html.light .bg-slate-800 { background-color: #E5E7EB !important; }
198204
html.light .bg-slate-900 { background-color: #F3F4F6 !important; }
199205
html.light .bg-slate-950 { background-color: #F9FAFB !important; }
206+
html.light .bg-slate-800\/80 { background-color: #E5E7EB !important; }
207+
html.light .bg-slate-900\/50 { background-color: rgba(0, 0, 0, 0.03) !important; }
208+
html.light .bg-slate-900\/30 { background-color: rgba(0, 0, 0, 0.02) !important; }
209+
html.light .bg-slate-700\/50 { background-color: rgba(0, 0, 0, 0.05) !important; }
210+
html.light .bg-slate-500\/20 { background-color: rgba(0, 0, 0, 0.06) !important; }
211+
html.light .bg-slate-500\/30 { background-color: rgba(0, 0, 0, 0.06) !important; }
212+
/* Fallback attribute selectors */
200213
html.light [class*="bg-slate-800\\/"] { background-color: rgba(0, 0, 0, 0.04) !important; }
201214
html.light [class*="bg-slate-900\\/"] { background-color: rgba(0, 0, 0, 0.03) !important; }
202215
html.light [class*="bg-slate-700\\/"] { background-color: rgba(0, 0, 0, 0.05) !important; }
203216
html.light [class*="bg-slate-500\\/"] { background-color: rgba(0, 0, 0, 0.06) !important; }
204217

205218
/* Slate borders */
206-
html.light .border-slate-700 { border-color: rgba(0, 0, 0, 0.10) !important; }
219+
html.light .border-slate-700 { border-color: rgba(0, 0, 0, 0.12) !important; }
207220
html.light .border-slate-800 { border-color: rgba(0, 0, 0, 0.08) !important; }
221+
html.light .border-slate-500\/30 { border-color: rgba(0, 0, 0, 0.12) !important; }
222+
html.light .border-slate-500\/20 { border-color: rgba(0, 0, 0, 0.10) !important; }
208223
html.light [class*="border-slate-500\\/"] { border-color: rgba(0, 0, 0, 0.12) !important; }
209224
html.light [class*="border-slate-700\\/"] { border-color: rgba(0, 0, 0, 0.08) !important; }
210225

211226
/* Zinc backgrounds */
227+
html.light .bg-zinc-700 { background-color: #D1D5DB !important; }
212228
html.light .bg-zinc-800 { background-color: #E5E7EB !important; }
229+
html.light .bg-zinc-800\/80 { background-color: #E5E7EB !important; }
213230
html.light .bg-zinc-900 { background-color: #F3F4F6 !important; }
214231
html.light .bg-zinc-950 { background-color: #F9FAFB !important; }
215232

@@ -250,25 +267,38 @@ html.light .bg-white.text-zinc-950:hover {
250267
background-color: #2D2D44 !important;
251268
}
252269

253-
/* Ghost button */
254-
html.light [class*="bg-white\\/\\[0\\.06\\]"][class*="border"][class*="text-zinc-300"] {
255-
background-color: rgba(0, 0, 0, 0.04);
256-
border-color: rgba(0, 0, 0, 0.12);
257-
color: #374151;
270+
/* Ghost button + hover states for transparent white backgrounds */
271+
html.light .bg-white\/\[0\.06\] {
272+
background-color: rgba(0, 0, 0, 0.05) !important;
273+
border-color: rgba(0, 0, 0, 0.15) !important;
258274
}
259-
html.light [class*="bg-white\\/\\[0\\.06\\]"][class*="border"][class*="text-zinc-300"]:hover {
260-
background-color: rgba(0, 0, 0, 0.08);
261-
color: #1A1A2E;
275+
html.light .bg-white\/\[0\.1\] {
276+
background-color: rgba(0, 0, 0, 0.08) !important;
277+
}
278+
html.light .bg-white\/\[0\.04\] {
279+
background-color: rgba(0, 0, 0, 0.04) !important;
280+
}
281+
html.light .bg-white\/\[0\.03\] {
282+
background-color: rgba(0, 0, 0, 0.03) !important;
262283
}
263284

264285
/* GitHub star button */
265-
html.light a[class*="bg-white\\/5"][class*="border-white\\/10"] {
266-
background-color: rgba(0, 0, 0, 0.03);
267-
border-color: rgba(0, 0, 0, 0.10);
268-
color: #374151;
286+
html.light .bg-white\/5 {
287+
background-color: rgba(0, 0, 0, 0.04) !important;
288+
}
289+
html.light .bg-white\/10 {
290+
background-color: rgba(0, 0, 0, 0.06) !important;
291+
}
292+
293+
/* All select elements in light mode */
294+
html.light select {
295+
background-color: #F3F4F6 !important;
296+
color: #1E293B !important;
297+
border-color: rgba(0, 0, 0, 0.12) !important;
269298
}
270-
html.light a[class*="bg-white\\/5"][class*="border-white\\/10"]:hover {
271-
background-color: rgba(0, 0, 0, 0.06);
299+
html.light select option {
300+
background-color: #FFFFFF;
301+
color: #1A1A2E;
272302
}
273303

274304
/* --- Version badge --- */
@@ -282,6 +312,39 @@ html.light .border-accent-indigo\\/30 {
282312
/* --- Hero background gradients: reduce on light mode --- */
283313
html.light section > [aria-hidden="true"] { opacity: 0.15; }
284314

315+
/* --- Playground: override hardcoded arbitrary bg --- */
316+
html.light .bg-\[\#09090b\] { background-color: #FAFBFC !important; }
317+
html.light .bg-\[\#0F172A\] { background-color: #FAFBFC !important; }
318+
319+
/* Playground select element */
320+
html.light .bg-slate-800.text-slate-200 {
321+
background-color: #F3F4F6 !important;
322+
color: #1E293B !important;
323+
border-color: rgba(0, 0, 0, 0.12) !important;
324+
}
325+
326+
/* Playground active tab */
327+
html.light .text-blue-400 { color: #2563EB !important; }
328+
html.light .bg-blue-500 { background-color: #3B82F6 !important; }
329+
330+
/* Playground emerald code */
331+
html.light code .text-emerald-400,
332+
html.light code.text-emerald-400 { color: #059669 !important; }
333+
html.light .bg-slate-800.rounded { background-color: #E5E7EB !important; }
334+
335+
/* Playground divider */
336+
html.light .bg-slate-700 { background-color: #D1D5DB !important; }
337+
338+
/* Playground copy/bottom bar hover */
339+
html.light .hover\:text-white:hover { color: #1A1A2E !important; }
340+
html.light .hover\:border-slate-500:hover { border-color: rgba(0, 0, 0, 0.2) !important; }
341+
342+
/* Loading skeleton in playground */
343+
html.light .animate-pulse.bg-zinc-800 { background-color: #E5E7EB !important; }
344+
345+
/* Green dot (parser ready) — keep green */
346+
html.light .bg-green-500 { background-color: #22C55E !important; }
347+
285348
/* --- Code blocks / pre elements --- */
286349
html.light pre[class*="font-mono"] {
287350
background-color: #1E1E2E;

0 commit comments

Comments
 (0)