From c7c1074f28fe6b1f7919a7f4deb8329b869699e3 Mon Sep 17 00:00:00 2001 From: Zanuar Tri Romadon Date: Sun, 10 May 2026 21:07:59 +0700 Subject: [PATCH] fix: improve dropdown text readability in dark theme on usage page (#997) - Add global CSS rules for select elements in dark mode - Use color-scheme property to signal dark mode to browser - Explicitly style option elements with dark theme colors - Fix UsageStats dropdown to use correct CSS variables (bg-surface, text-text-main) Fixes dropdown text being unreadable in dark theme on usage page: - Provider filter dropdown - Table view selector (Model/Account/API Key/Endpoint) - Pagination page size selector Tested in Chrome and Firefox with both light and dark themes. --- .../usage/components/RequestDetailsTab.js | 1 + src/app/globals.css | 16 ++++++++++++++++ src/shared/components/Pagination.js | 1 + src/shared/components/UsageStats.js | 3 ++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js b/src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js index 1d52d88a..e450dd94 100644 --- a/src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js +++ b/src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js @@ -183,6 +183,7 @@ export default function RequestDetailsTab() { "text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20", "w-full min-w-0 cursor-pointer" )} + style={{ colorScheme: 'auto' }} > {providers.map((provider) => ( diff --git a/src/app/globals.css b/src/app/globals.css index 4decd9e1..25599391 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -114,6 +114,22 @@ color-scheme: dark; } +/* ============================================================ + Fix native select dropdowns in dark mode + ============================================================ */ +select { + color-scheme: light; +} + +.dark select { + color-scheme: dark; +} + +.dark select option { + background-color: var(--color-surface); + color: var(--color-text-main); +} + @theme inline { /* Brand scale */ --color-brand-50: var(--color-brand-50); diff --git a/src/shared/components/Pagination.js b/src/shared/components/Pagination.js index 5c4f9080..913f5eb6 100644 --- a/src/shared/components/Pagination.js +++ b/src/shared/components/Pagination.js @@ -63,6 +63,7 @@ export default function Pagination({ "text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20", "cursor-pointer" )} + style={{ colorScheme: 'auto' }} > {[10, 20, 50].map((size) => (