From e8aec766f6746d98899e89d3393c7f5c1b4dfa4b Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Mon, 15 Jul 2024 09:53:02 +0200 Subject: [PATCH 1/2] Fix css selector for recovery-codes-list parseRecoveryCodeList (#31260,#31287) The recovery-codes-list should be addressed by element ID not by CSS class. Fixes #31260 Fixes #31287 Signed-off-by: Thomas Darimont --- .../theme/base/login/login-recovery-authn-code-config.ftl | 2 +- .../resources/theme/keycloak/login/resources/css/login.css | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/themes/src/main/resources/theme/base/login/login-recovery-authn-code-config.ftl b/themes/src/main/resources/theme/base/login/login-recovery-authn-code-config.ftl index 143da9e2b0b..28641599466 100644 --- a/themes/src/main/resources/theme/base/login/login-recovery-authn-code-config.ftl +++ b/themes/src/main/resources/theme/base/login/login-recovery-authn-code-config.ftl @@ -106,7 +106,7 @@ } function parseRecoveryCodeList() { - var recoveryCodes = document.querySelectorAll(".kc-recovery-codes-list li"); + var recoveryCodes = document.querySelectorAll("#kc-recovery-codes-list li"); var recoveryCodeList = ""; for (var i = 0; i < recoveryCodes.length; i++) { diff --git a/themes/src/main/resources/theme/keycloak/login/resources/css/login.css b/themes/src/main/resources/theme/keycloak/login/resources/css/login.css index b9ce1e573c8..7b8f7970034 100644 --- a/themes/src/main/resources/theme/keycloak/login/resources/css/login.css +++ b/themes/src/main/resources/theme/keycloak/login/resources/css/login.css @@ -589,18 +589,19 @@ ul#kc-totp-supported-apps { .kc-recovery-codes-warning .pf-c-alert__description p { font-size: 0.875rem; } -.kc-recovery-codes-list { + +#kc-recovery-codes-list { list-style: none; columns: 2; margin: 16px 0; padding: 16px 16px 8px 16px; border: 1px solid #D2D2D2; } -.kc-recovery-codes-list li { +#kc-recovery-codes-list li { margin-bottom: 8px; font-size: 11px; } -.kc-recovery-codes-list li span { +#kc-recovery-codes-list li span { color: #6A6E73; width: 16px; text-align: right; From a13052023cc2acecedd47fb9f1b8b015fa769f9d Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Mon, 15 Jul 2024 10:31:12 +0200 Subject: [PATCH 2/2] Ensure that recovery codes are taking into account for keycloak.v2 login theme Signed-off-by: Thomas Darimont --- .../login/resources/css/styles.css | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/themes/src/main/resources/theme/keycloak.v2/login/resources/css/styles.css b/themes/src/main/resources/theme/keycloak.v2/login/resources/css/styles.css index 9e816fcf7d0..d1b51d72687 100644 --- a/themes/src/main/resources/theme/keycloak.v2/login/resources/css/styles.css +++ b/themes/src/main/resources/theme/keycloak.v2/login/resources/css/styles.css @@ -69,3 +69,46 @@ div.kc-logo-text span { border-color: transparent black transparent transparent; } +/* Recovery codes */ +.kc-recovery-codes-warning { + margin-bottom: 32px; +} +.kc-recovery-codes-warning .pf-c-alert__description p { + font-size: 0.875rem; +} + +#kc-recovery-codes-list { + list-style: none; + columns: 2; + margin: 16px 0; + padding: 16px 16px 8px 16px; + border: 1px solid #D2D2D2; +} +#kc-recovery-codes-list li { + margin-bottom: 8px; + font-size: 11px; +} +#kc-recovery-codes-list li span { + color: #6A6E73; + width: 16px; + text-align: right; + display: inline-block; + margin-right: 1px; +} + +.kc-recovery-codes-actions { + margin-bottom: 24px; +} +.kc-recovery-codes-actions button { + padding-left: 0; +} +.kc-recovery-codes-actions button i { + margin-right: 8px; +} + +.kc-recovery-codes-confirmation { + align-items: baseline; + margin-bottom: 16px; +} + +/* End Recovery codes */