Keycloakify
HomeGitHubStorybookAlternative to keycloak-js
v11
  • Documentation
  • Release Notes & Upgrade Instructions
  • FAQ
v11
  • Quick Start
  • CSS Customization
  • Testing your Theme
    • Outside of Keycloak
    • Inside of Keycloak
  • Deploying Your Theme
  • Integrating Keycloakify in your Codebase
    • Vite
    • Create-React-App / Webpack
    • yarn/npm/pnpm/bun Workspaces
    • Turborepo
    • Nx
    • Angular Workspace
  • Common Use Case Examples
    • Using a Component Library
    • Custom Fonts
    • Changing the background image
    • Adding your Logo
    • Using Tailwind
    • Dark Mode Persistence
  • Features
    • Internationalization and Translations
      • Basic principles
      • Previewing Your Pages in Different Languages
      • Adding New Translation Messages or Changing the Default Ones
      • Adding Support for Extra Languages
    • Theme Variants
    • Environment Variables
    • Styling a Custom Page Not Included in Base Keycloak
    • Integrating an Existing Theme into Your Keycloakify Project
    • Compiler Options
      • --project
      • keycloakVersionTargets
      • environmentVariables
      • themeName
      • startKeycloakOptions
      • themeVersion
      • accountThemeImplementation
      • postBuild
      • XDG_CACHE_HOME
      • kcContextExclusionsFtl
      • keycloakifyBuildDirPath
      • groupId
      • artifactId
      • Webpack specific options
        • projectBuildDirPath
        • staticDirPathInProjectBuildDirPath
        • publicDirPath
  • Page-Specific Guides
    • Registration Page
    • Terms and Conditions Page
  • Theme types
    • Differences Between Login Themes and Other Types of Themes
    • Account Theme
      • Single-Page
      • Multi-Page
    • Email Theme
    • Admin Theme
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Features

Integrating an Existing Theme into Your Keycloakify Project

Last updated 4 months ago

Was this helpful?

If you have already created a Keycloak theme using the native theming system, you can easily import it into your Keycloakify project.

This process is straightforward and requires no special configuration. Simply copy the source files of your existing theme and place them into the src directory of your Keycloakify project.

Below is a live demonstration using a login theme, but the same process applies to any type of theme.

Theme Variants Support

If your project includes theme variants, they will also work seamlessly with your imported native theme.

You can leverage a special FreeMarker variable in your .ftl files to display the active theme variant dynamically:

src/login/login.ftl
<h1>${xKeycloakify.themeName}</h1>

To customize translations based on the active theme variant, create property files with the following naming pattern:

messages/messages_<language>_override_<theme name>.properties

For example, if you have theme variants named vanilla and chocolate, you can override the loginAccountTitle message key for each variant. Here's an example project structure:

Screenshot showing a native login theme inside a Keycloakify project
A project with two theme variants, "vanilla" and "chocolate," where the loginAccountTitle message key is overridden for each variant.
Native login theme in a Keycloakify project
Theme variants: vanilla and chocolate