Keywind is a component-based Keycloak Login Theme built with Tailwind CSS
Find a file
2024-02-21 02:06:29 +07:00
html/login feat: add password visibility button (#56) 2023-12-13 23:00:00 +04:00
META-INF Initial commit 2021-07-05 18:40:00 +07:00
scripts feat: add script to create jar archive 2023-03-11 00:00:00 +04:00
src feat: add password visibility button (#56) 2023-12-13 23:00:00 +04:00
theme/keywind/login improve local development process by hot reload 2024-02-21 02:06:29 +07:00
.editorconfig Initial commit 2021-07-05 18:40:00 +07:00
.gitignore improve local development process by hot reload 2024-02-21 02:06:29 +07:00
.prettierrc chore(deps): update dependencies 2021-11-21 18:40:00 +07:00
docker-compose.yml improve local development process by hot reload 2024-02-21 02:06:29 +07:00
LICENSE Initial commit 2021-07-05 18:40:00 +07:00
package.json feat: add password visibility button (#56) 2023-12-13 23:00:00 +04:00
pnpm-lock.yaml test: add login theme tests 2023-09-24 00:00:00 +04:00
pom.xml test: add login theme tests 2023-09-24 00:00:00 +04:00
postcss.config.js feat!: migrate from snowpack to vite 2022-09-03 09:00:00 +01:00
preview.png feat!: add identity provider icons 2022-10-16 18:00:00 +04:00
README.md improve local development process by hot reload 2024-02-21 02:06:29 +07:00
tailwind.config.ts test: add login theme tests 2023-09-24 00:00:00 +04:00
tsconfig.json test: add login theme tests 2023-09-24 00:00:00 +04:00
tsconfig.node.json test: add login theme tests 2023-09-24 00:00:00 +04:00
vite.config.ts feat: add recovery authn code and webauthn pages (#23) 2022-11-08 14:57:53 +01:00

🌬️ Keywind

Keywind is a component-based Keycloak Login Theme built with Tailwind CSS and Alpine.js.

Preview

Styled Pages

  • Error
  • Login
  • Login Config TOTP
  • Login IDP Link Confirm
  • Login OAuth Grant
  • Login OTP
  • Login Page Expired
  • Login Password
  • Login Recovery Authn Code Config
  • Login Recovery Authn Code Input
  • Login Reset Password
  • Login Update Password
  • Login Update Profile
  • Login Username
  • Login X.509 Info
  • Logout Confirm
  • Register
  • Select Authenticator
  • Terms and Conditions
  • WebAuthn Authenticate
  • WebAuthn Error
  • WebAuthn Register

Identity Provider Icons

  • Apple
  • Bitbucket
  • Discord
  • Facebook
  • GitHub
  • GitLab
  • Google
  • Instagram
  • LinkedIn
  • Microsoft
  • OpenID
  • Red Hat OpenShift
  • PayPal
  • Slack
  • Stack Overflow
  • Twitter

Installation

Keywind has been designed with component-based architecture from the start, and you can customize as little or as much Keywind as you need:

  1. Deploy Keywind Login Theme
  2. Create your own Login Theme
  3. Specify parent theme in theme properties:
parent=keywind
  1. Brand and customize components with FreeMarker

Customization

Local development

Use docker-compose to initialize Keycloak locally, making it easy to check the results when you edit Keywind.

docker compose up -d // start keycloak for testing

Then, select the login theme for the client in Keycloak as Keywind.

Finally, let Vite do its job.

pnpm run dev // watch *.ftl changes and regenerate css

You can go to the client's login page to see. The key point here is that for realms with the display name Keycloak (by default), CSS and JS will use the Vite link, while for other cases, they will still use the built link. In document.ftl, this trick to enable hot reload when developing the theme and it work.

  <#if realm.displayName == 'Keycloak'>
    <link href="http://localhost:5173/src/index.css" rel="stylesheet">
    <script defer src="http://localhost:5173/src/index.ts" type="module"></script>
  </#if>

Theme

When you do need to customize a palette, you can configure your colors under the colors key in the theme section of Tailwind config file:

tailwind.config.js

module.exports = {
  theme: {
    extend: {
      colors: {
        primary: colors.red,
      },
    },
  },
};

Read more about Tailwind CSS configuration in the documentation.

Components

You can update Keywind components in your own child theme. For example, create a copy of the body component and change the background:

theme/mytheme/login/components/atoms/body.ftl

<#macro kw>
  <body class="bg-primary-100">
    <#nested>
  </body>
</#macro>

Build

When you're ready to deploy your own theme, run the build command to generate a static production build.

pnpm install
pnpm build

To deploy a theme as an archive, create a JAR archive with the theme resources.

pnpm build:jar