From faf9f35992bdcb3670ec43bb85e7b22db96a3cab Mon Sep 17 00:00:00 2001 From: NixReaper Date: Sun, 12 Jul 2026 14:49:03 -0500 Subject: [PATCH] Expand login customizer: background, colors, custom CSS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend Settings > Login (beyond the existing style toggle + logo) toward Loginfy parity: background image or color, form-panel background, button/ focus-accent color, and a custom login CSS field — all dependent on "Style login page" and all falling back to the original fixed dark theme when unset. LoginStyle.php sanitizes colors via sanitize_hex_color(), esc_url()s the background image, and appends custom CSS ( stripped). Verified on wp-login.php. Co-Authored-By: Claude Opus 4.8 --- admin/src/Login/LoginStyle.php | 33 ++++++++++++++----- app/src/pages/settings/settingsConfig.js | 42 ++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 9 deletions(-) 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. ?>