From 57f0bf6b4b432d154a9ee743c63681e74c405aab Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Wed, 11 Feb 2026 22:43:52 -0500 Subject: [PATCH] fix: add dark mode support using MUI CSS variables Replace all hardcoded colors with Headlamp's MUI CSS variables to ensure proper theme support in both light and dark modes. This fixes the issue where plugin UI elements had white backgrounds when the site switched to dark mode. Changes: - PolarisSettings: Use theme variables for input, button, text colors - ExemptionManager: Use theme variables for all buttons and UI elements - DashboardView: Use theme variables for refresh button - AppBarScoreBadge: Keep semantic colors (green/orange/red) for status CSS Variables Used: - --mui-palette-primary-main: Primary action color - --mui-palette-primary-contrastText: Text on primary bg - --mui-palette-background-paper: Card/paper backgrounds - --mui-palette-text-primary: Primary text color - --mui-palette-text-secondary: Secondary text color - --mui-palette-divider: Border/divider colors - --mui-palette-action-disabled: Disabled text color - --mui-palette-action-disabledBackground: Disabled bg color - --mui-palette-error-main: Error/danger actions All tests passing (50/50), build successful. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- src/components/DashboardView.tsx | 4 ++-- src/components/ExemptionManager.tsx | 30 +++++++++++++++++++++-------- src/components/PolarisSettings.tsx | 20 +++++++++++++++---- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/components/DashboardView.tsx b/src/components/DashboardView.tsx index 5f358d4..857f288 100644 --- a/src/components/DashboardView.tsx +++ b/src/components/DashboardView.tsx @@ -117,8 +117,8 @@ export default function DashboardView() { style={{ padding: '6px 16px', backgroundColor: 'transparent', - color: '#1976d2', - border: '1px solid #1976d2', + color: 'var(--mui-palette-primary-main, #1976d2)', + border: '1px solid var(--mui-palette-primary-main, #1976d2)', borderRadius: '4px', cursor: 'pointer', fontSize: '13px', diff --git a/src/components/ExemptionManager.tsx b/src/components/ExemptionManager.tsx index 20bb4c9..46c8b49 100644 --- a/src/components/ExemptionManager.tsx +++ b/src/components/ExemptionManager.tsx @@ -149,8 +149,8 @@ export default function ExemptionManager({