From 3f4448c641f71af2f7ee70cbb277641cd840d0bc Mon Sep 17 00:00:00 2001 From: nevaforget Date: Thu, 9 Apr 2026 14:51:29 +0200 Subject: [PATCH] style: replace hardcoded colors with GTK theme variables Use @theme_bg_color, @theme_fg_color, @error_color and @success_color instead of hardcoded hex values and 'white'. Makes moonlock respect the active GTK theme instead of assuming Catppuccin Mocha colors. Note: moongreet and moonset still use hardcoded colors and should be updated to match. --- resources/style.css | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/resources/style.css b/resources/style.css index fd38e1c..28831a9 100644 --- a/resources/style.css +++ b/resources/style.css @@ -1,9 +1,9 @@ /* ABOUTME: GTK4 CSS stylesheet for the Moonlock lockscreen. */ -/* ABOUTME: Dark theme styling matching the Moonarch ecosystem. */ +/* ABOUTME: Uses GTK theme colors for consistency with the active desktop theme. */ /* Main window background */ window.lockscreen { - background-color: #1a1a2e; + background-color: @theme_bg_color; background-size: cover; background-position: center; opacity: 0; @@ -27,14 +27,14 @@ window.lockscreen.visible { min-width: 128px; min-height: 128px; background-color: @theme_selected_bg_color; - border: 3px solid alpha(white, 0.3); + border: 3px solid alpha(@theme_fg_color, 0.3); } /* Username label */ .username-label { font-size: 24px; font-weight: bold; - color: white; + color: @theme_fg_color; margin-top: 12px; margin-bottom: 40px; } @@ -46,29 +46,29 @@ window.lockscreen.visible { /* Error message label */ .error-label { - color: #ff6b6b; + color: @error_color; font-size: 14px; } /* Fingerprint status indicator */ .fingerprint-label { - color: alpha(white, 0.6); + color: alpha(@theme_fg_color, 0.6); font-size: 13px; margin-top: 8px; } .fingerprint-label.success { - color: #51cf66; + color: @success_color; } .fingerprint-label.failed { - color: #ff6b6b; + color: @error_color; } /* Confirmation prompt */ .confirm-label { font-size: 16px; - color: white; + color: @theme_fg_color; margin-bottom: 4px; } @@ -103,12 +103,12 @@ window.lockscreen.visible { min-height: 48px; padding: 0px; border-radius: 24px; - background-color: alpha(white, 0.1); - color: white; + background-color: alpha(@theme_fg_color, 0.1); + color: @theme_fg_color; border: none; margin: 4px; } .power-button:hover { - background-color: alpha(white, 0.25); + background-color: alpha(@theme_fg_color, 0.25); }