8000 Unify login theme actions and styling hooks by kathari00 · Pull Request #52724 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Unify login theme actions and styling hooks - #52724

Merged
rmartinc merged 1 commit into
keycloak:mainfrom
kathari00:fix/login-theme-action-spacing
Nov 10, 2026
Merged

rmartinc merged 1 commit into
keycloak:mainfrom
kathari00:fix/login-theme-action-spacing

Conversation

@kathari00
@kathari00 kathari00 commented Sep 13, 2026 •
Copy link
Copy Markdown
Contributor

Closes #52723
Closes #54547

Summary

  • Move the Login v2 pages, layout, and reusable components into the new Base login theme. keycloak.v2 now supplies theme properties and resources and inherits its FreeMarker templates from Base.
  • Keep framework styling in theme properties rather than hard-coding PatternFly classes in the new Base. Move shared social-provider images into Base and deduplicate the JavaScript resources used by the themes.
  • Reuse the shared field and button macros across pages while retaining form values, IDs, validation attributes, reCAPTCHA attributes, and the relevant action and styling hooks.

Migration

Custom login themes with parent=base will inherit the new Base markup. Review and update their template overrides and CSS to match the new structure. The upgrade guide documents this change.

Validation

A fresh rendered-state comparison and manual authentication-flow check have not yet been completed for the current revision.

Follow-ups

Additional alert, form, and header customization hooks can be handled in follow-up changes.

Editor-specific padding and bottom-alignment CSS are outside this PR.

Copilot AI balanced review requested due to automatic review settings September 13, 2026 20:33
@kathari00
kathari00 requested review from a team as code owners September 13, 2026 20:33
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review comments were supplied, and the changes are limited to consistent styling and layout updates.

Pull request overview

This pull request standardizes button styling and action spacing across Keycloak login themes.

Changes:

  • Adds shared form, button, and spacing properties.
  • Normalizes action placement in v2 login templates.
  • Applies consistent styling to inherited base templates.
File summaries
File Description
themes/src/main/resources/theme/keycloak.v2/login/update-email.ftl Relocates the action group to form level.
themes/src/main/resources/theme/keycloak.v2/login/theme.properties Adds shared button and spacing mappings.
themes/src/main/resources/theme/keycloak.v2/login/terms.ftl Places terms content and actions within the form.
themes/src/main/resources/theme/keycloak.v2/login/login-recovery-authn-code-config.ftl Adds shared form and button action styling.
themes/src/main/resources/theme/keycloak.v2/login/link-idp-action.ftl Aligns message and actions within the form.
themes/src/main/resources/theme/keycloak.v2/login/delete-credential.ftl Aligns message and actions within the form.
themes/src/main/resources/theme/base/login/saml-post-form.ftl Styles the no-JavaScript submit control.
themes/src/main/resources/theme/base/login/logout-confirm.ftl Applies form, action, and link spacing styling.
themes/src/main/resources/theme/base/login/login-x509-info.ftl Enables secondary button styling for Ignore.
themes/src/main/resources/theme/base/login/login-idp-link-confirm-override.ftl Adds shared form and action-container styling.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 0
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#salesMetadataTest

Keycloak CI - Adapter IT Strict Cookies

org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
...

Report flaky test

edewit
edewit previously approved these changes Sep 14, 2026
@mabartos mabartos left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kathari00 Thanks for the PR!

I see that for the base theme, we use the <button> elements that causes so many unstable styling with the login v2.

What if we migrate the buttons macro in the base theme and reuse it as much as possible?

Comment on lines +61 to +64
<div class="${properties.kcFormButtonsClass!}">
<#if isAppInitiatedAction??>
<input type="submit"
class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to reuse the buttons macro?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to move all reusable components into base generally? I can propose something. This would make custom theme styling a lot easier (I tried to do it with Bootstrap and Carbon).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make my earlier suggestion more concrete i would start with divider.ftl and qr-code.ftl, since both already use theme properties for styling. Another candidate is shared checkbox rendering eg in logoutOtherSessions. Does that scope make sense and would you prefer a separate PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kathari00 We can provide additional macros in the follow-ups, but I agree.

Copilot AI review requested due to automatic review settings September 24, 2026 06:50
@kathari00
kathari00 force-pushed the fix/login-theme-action-spacing branch from 280910a to 9032cc0 Compare September 24, 2026 06:50
@kathari00 kathari00 changed the title Fix button styling and action spacing in login themes Unify login theme actions and styling hooks Sep 24, 2026
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Critical test-resource and logout-selector failures remain, along with three theme compatibility regressions.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 High severity

Open (2)

Copilot AI review requested due to automatic review settings September 24, 2026 07:00
@kathari00
kathari00 force-pushed the fix/login-theme-action-spacing branch from 9032cc0 to 3bbe5e7 Compare September 24, 2026 07:00
@kathari00
kathari00 requested review from a team as code owners September 24, 2026 07:00
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Several test-framework/ui page objects still target submit inputs and will fail after controls migrate to buttons.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 High severity · 2 Medium severity

Open (4)

Copilot AI review requested due to automatic review settings September 24, 2026 07:07
@kathari00
kathari00 force-pushed the fix/login-theme-action-spacing branch from 3bbe5e7 to 1a436d8 Compare September 24, 2026 07:07
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Three moderate styling and theme-inheritance compatibility issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 High severity · 4 Medium severity

Open (6)

Copilot AI review requested due to automatic review settings September 24, 2026 08:36
@kathari00
kathari00 force-pushed the fix/login-theme-action-spacing branch from 1a436d8 to c94355d Compare September 24, 2026 08:36
@mabartos
mabartos force-pushed the fix/login-theme-action-spacing branch from 7e6e618 to 743fdfa Compare November 10, 2026 08:24
Copilot AI balanced review requested due to automatic review settings November 10, 2026 08:24
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Client-side validation rejects Unicode digits accepted by the server, and the PR’s migration instructions recommend a nonexistent parent theme.

1 open issue
1 resolved since last review

Review effort: Balanced

@mabartos
Copy link
Copy Markdown
Member

As discussed offline, we're not going to introduce the base-legacy. Updated and ready for review.

mabartos
mabartos previously approved these changes Nov 10, 2026
edewit
edewit previously approved these changes Nov 10, 2026
<form id="kc-select-credential-form" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post">
<input type="hidden" name="authenticationExecution" value="${authenticationSelection.authExecId}">
</form>
<div role="button" class="${properties.kcSelectAuthListItemClass!}" tabindex="0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be nicer to have button type="submit" then we don't need javascript for this

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edewit Yep, I think there might be more stuff that we can polish here. We can do it in a follow-up.

@mabartos
mabartos requested a review from rmartinc November 10, 2026 10:12
@rmartinc rmartinc left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @kathari00! It's a big change. I have just tested a bit and I see no issues in the login pages. So I will approve based on the previous reviews. But there is a conflict in the upgrading note (I suppose there is a new note added recently, just move your note after the new one).

Move all login pages, macros and the layout (template.ftl) from
keycloak.v2 into the Base theme. Base reads every framework class from
theme properties, so keycloak.v2 now consists only of theme.properties
and resources, and other themes can restyle the login pages through
properties or by overriding single macros instead of whole pages.

Closes keycloak#52723

Signed-off-by: kathari00 <katharina.eiserfey1@gmail.com>
Co-authored-by: Martin Bartoš <mabartos@redhat.com>
@mabartos
mabartos dismissed stale reviews from edewit and themself via 15c9510 November 10, 2026 13:48
@mabartos
mabartos force-pushed the fix/login-theme-action-spacing branch from 743fdfa to 15c9510 Compare November 10, 2026 13:48
Copilot AI balanced review requested due to automatic review settings November 10, 2026 13:48
@mabartos
Copy link
Copy Markdown
Member

@rmartinc Ahh, I've just fixed the conflict, but you were faster :)

@mabartos
mabartos requested a review from rmartinc November 10, 2026 13:50
@rmartinc
Copy link
Copy Markdown
Contributor

👍 No problem @mabartos! I will approve when CI passes.

@mabartos
mabartos commented Nov 10, 2026 •
Copy link
Copy Markdown
Member

@rmartinc Ok, thanks! Tip: you can use the auto-merge that merges the PR automatically if the CI passes.

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Broad authentication-template and theme changes lack fresh mobile/desktop rendering comparisons and browser-level flow validation needed to assess regressions.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@mabartos
mabartos dismissed stianst’s stale review November 10, 2026 15:29

Stian commented only about the legacy base user and we discussed about it offline, and we're on the same page now. Right now, the existing reviews are sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce a reusable base login theme Button styling and action spacing inconsistencies in keycloak.v2

7 participants

0