keywind/README.md

120 lines
2.6 KiB
Markdown
Raw Normal View History

2021-07-05 11:40:00 +00:00
# :wind_face: Keywind
2023-09-25 06:53:18 +00:00
Keywind is a component-based Keycloak Login & E-Mail Theme built with [Tailwind CSS](https://github.com/tailwindlabs/tailwindcss), [Mailwind](https://www.mailwind.io/) and [Alpine.js](https://github.com/alpinejs/alpine).
2021-07-05 11:40:00 +00:00
2023-09-25 06:53:18 +00:00
![Preview Login](./preview-login.png)
![Preview Login](./preview-email.png)
2021-07-05 11:40:00 +00:00
2021-11-21 12:20:00 +00:00
### Styled Pages
- Error
2021-11-21 12:20:00 +00:00
- Login
2022-04-05 20:20:00 +00:00
- Login Config TOTP
2021-11-21 12:20:00 +00:00
- Login IDP Link Confirm
2022-12-17 19:00:00 +00:00
- Login OAuth Grant
2022-04-05 20:20:00 +00:00
- Login OTP
- Login Page Expired
- Login Password
2023-02-04 20:00:00 +00:00
- Login Recovery Authn Code Config
- Login Recovery Authn Code Input
2021-11-21 12:20:00 +00:00
- Login Reset Password
- Login Update Password
- Login Update Profile
- Login Username
2022-09-25 19:00:00 +00:00
- Logout Confirm
2021-11-21 12:20:00 +00:00
- Register
2023-02-04 20:00:00 +00:00
- Select Authenticator
- Terms and Conditions
2023-02-04 20:00:00 +00:00
- WebAuthn Authenticate
- WebAuthn Error
- WebAuthn Register
2021-11-21 12:20:00 +00:00
2022-10-16 14:00:00 +00:00
### Identity Provider Icons
2021-11-21 12:20:00 +00:00
2023-09-10 16:50:00 +00:00
- Apple
2022-10-16 14:00:00 +00:00
- Bitbucket
2023-03-26 17:40:01 +00:00
- Discord
2021-11-21 12:20:00 +00:00
- Facebook
- GitHub
2022-10-16 14:00:00 +00:00
- GitLab
2021-11-21 12:20:00 +00:00
- Google
2022-10-16 14:00:00 +00:00
- Instagram
- LinkedIn
2021-11-21 12:20:00 +00:00
- Microsoft
2022-10-16 14:00:00 +00:00
- OpenID
- Red Hat OpenShift
- PayPal
2023-02-02 20:00:00 +00:00
- Slack
2022-10-16 14:00:00 +00:00
- Stack Overflow
- Twitter
2021-11-21 12:20:00 +00:00
2021-07-05 11:40:00 +00:00
## 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**:
2023-09-25 06:53:18 +00:00
1. [Deploy Keywind Themes](https://www.keycloak.org/docs/latest/server_development/#deploying-themes)
2. [Create your own Themes](https://www.keycloak.org/docs/latest/server_development/#creating-a-theme)
2021-07-05 11:40:00 +00:00
3. Specify parent theme in [theme properties](https://www.keycloak.org/docs/latest/server_development/#theme-properties):
```
parent=keywind
```
2023-01-23 21:37:14 +00:00
4. Brand and customize components with [FreeMarker](https://freemarker.apache.org/docs/dgui_quickstart_template.html)
2021-07-05 11:40:00 +00:00
2021-11-21 12:20:00 +00:00
## Customization
2021-07-05 11:40:00 +00:00
2021-11-21 12:20:00 +00:00
### Theme
2021-07-05 11:40:00 +00:00
2023-01-14 20:00:00 +00:00
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`
2021-07-05 11:40:00 +00:00
```js
module.exports = {
theme: {
extend: {
colors: {
primary: colors.red,
},
},
},
2021-11-21 12:20:00 +00:00
};
2021-07-05 11:40:00 +00:00
```
Read more about Tailwind CSS configuration in the [documentation](https://tailwindcss.com/docs/configuration).
2021-11-21 12:20:00 +00:00
### Components
2021-07-05 11:40:00 +00:00
2023-01-14 20:00:00 +00:00
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`
2021-07-05 11:40:00 +00:00
```
2023-01-14 20:00:00 +00:00
<#macro kw>
<body class="bg-primary-100">
2021-07-05 11:40:00 +00:00
<#nested>
2023-01-14 20:00:00 +00:00
</body>
2021-07-05 11:40:00 +00:00
</#macro>
```
2023-09-25 06:53:18 +00:00
If you want to customize your own email components, update the files located in:
`theme/mytheme/email/html-src`
2021-11-21 12:20:00 +00:00
## Build
2021-07-05 11:40:00 +00:00
When you're ready to deploy your own theme, run the build command to generate a static production build.
```bash
2022-04-05 20:20:00 +00:00
pnpm install
pnpm build
2021-07-05 11:40:00 +00:00
```
2023-03-10 20:00:00 +00:00
To deploy a theme as an archive, create a JAR archive with the theme resources.
```bash
pnpm build:jar
```