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.
This commit is contained in:
parent
530dc9cb3b
commit
c7c1074f28
4 changed files with 20 additions and 1 deletions
|
|
@ -183,6 +183,7 @@ export default function RequestDetailsTab() {
|
||||||
"text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20",
|
"text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20",
|
||||||
"w-full min-w-0 cursor-pointer"
|
"w-full min-w-0 cursor-pointer"
|
||||||
)}
|
)}
|
||||||
|
style={{ colorScheme: 'auto' }}
|
||||||
>
|
>
|
||||||
<option value="">All Providers</option>
|
<option value="">All Providers</option>
|
||||||
{providers.map((provider) => (
|
{providers.map((provider) => (
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,22 @@
|
||||||
color-scheme: dark;
|
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 {
|
@theme inline {
|
||||||
/* Brand scale */
|
/* Brand scale */
|
||||||
--color-brand-50: var(--color-brand-50);
|
--color-brand-50: var(--color-brand-50);
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ export default function Pagination({
|
||||||
"text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20",
|
"text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20",
|
||||||
"cursor-pointer"
|
"cursor-pointer"
|
||||||
)}
|
)}
|
||||||
|
style={{ colorScheme: 'auto' }}
|
||||||
>
|
>
|
||||||
{[10, 20, 50].map((size) => (
|
{[10, 20, 50].map((size) => (
|
||||||
<option key={size} value={size}>
|
<option key={size} value={size}>
|
||||||
|
|
|
||||||
|
|
@ -455,7 +455,8 @@ export default function UsageStats({ period: periodProp, setPeriod: setPeriodPro
|
||||||
<select
|
<select
|
||||||
value={tableView}
|
value={tableView}
|
||||||
onChange={(e) => setTableView(e.target.value)}
|
onChange={(e) => setTableView(e.target.value)}
|
||||||
className="w-full rounded-lg border border-border bg-bg-subtle px-3 py-1.5 text-sm font-medium text-text focus:outline-none focus:ring-2 focus:ring-primary/50 sm:w-auto"
|
className="w-full rounded-lg border border-border bg-surface px-3 py-1.5 text-sm font-medium text-text-main focus:outline-none focus:ring-2 focus:ring-primary/50 sm:w-auto"
|
||||||
|
style={{ colorScheme: 'auto' }}
|
||||||
>
|
>
|
||||||
{TABLE_OPTIONS.map((opt) => (
|
{TABLE_OPTIONS.map((opt) => (
|
||||||
<option key={opt.value} value={opt.value}>{opt.label}</option>
|
<option key={opt.value} value={opt.value}>{opt.label}</option>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue