diff --git a/admin/src/Login/LoginStyle.php b/admin/src/Login/LoginStyle.php index d4cc67a..afa8237 100644 --- a/admin/src/Login/LoginStyle.php +++ b/admin/src/Login/LoginStyle.php @@ -42,10 +42,25 @@ class LoginStyle } $logo = trim((string) Settings::get("login_logo", "")); + $bg_image = trim((string) Settings::get("login_bg_image", "")); + // Colors fall back to the original fixed dark theme when unset; invalid + // values are dropped by sanitize_hex_color (returns null) then fall back. + $bg_color = sanitize_hex_color((string) Settings::get("login_bg_color", "")) ?: ""; + $form_bg = sanitize_hex_color((string) Settings::get("login_form_bg", "")) ?: "#1c2333"; + $accent = sanitize_hex_color((string) Settings::get("login_button_color", "")) ?: "#4f7cff"; + $custom_css = str_ireplace("", "", (string) Settings::get("login_custom_css", "")); + + if ($bg_image) { + $background = "url(" . esc_url($bg_image) . ") center / cover no-repeat"; + } elseif ($bg_color) { + $background = $bg_color; + } else { + $background = "linear-gradient(135deg, #1b2333 0%, #0f1420 100%)"; + } ?> stripped above. ?>