keywind/README.md

95 lines
2.3 KiB
Markdown
Raw Normal View History

2021-07-05 11:40:00 +00:00
# :wind_face: Keywind
Keywind is a component-based Keycloak Login Theme built with [Tailwind CSS](https://github.com/tailwindlabs/tailwindcss) and [Alpine.js](https://github.com/alpinejs/alpine).
![Preview](./preview.png)
2021-11-21 12:20:00 +00:00
### Styled Pages
- Login
- Login Config TOTP
2021-11-21 12:20:00 +00:00
- Login IDP Link Confirm
- Login OTP
2021-11-21 12:20:00 +00:00
- Login Reset Password
- Login Update Password
- Login Update Profile
2022-09-25 19:00:00 +00:00
- Logout Confirm
2021-11-21 12:20:00 +00:00
- Register
2022-10-16 14:00:00 +00:00
### Identity Provider Icons
2021-11-21 12:20:00 +00:00
2022-10-16 14:00:00 +00:00
- Bitbucket
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
- 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**:
1. [Deploy Keywind Login Theme](https://www.keycloak.org/docs/latest/server_development/#deploying-themes)
2. [Create your own Login Theme](https://www.keycloak.org/docs/latest/server_development/#creating-a-theme)
3. Specify parent theme in [theme properties](https://www.keycloak.org/docs/latest/server_development/#theme-properties):
```
parent=keywind
```
2021-11-21 12:20:00 +00:00
4. Brand and customize components with [FreeMaker](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
When you do need to customize a palette, you can configure your colors under the `colors` key in the `theme` section of `tailwind.config.js` file:
```js
// tailwind.config.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
You can inherit Keywind components in your own theme. For example, to resize the primary button you should create a styled `theme/mytheme/components/button/primary.ftl` file:
```
<#macro kw component="button" rest...>
<${component}
class="bg-primary-600 flex justify-center px-6 py-3 relative rounded-lg text-md text-white w-full focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-2 hover:bg-primary-700"
<#list rest as attrName, attrValue>
${attrName}="${attrValue}"
</#list>
>
<#nested>
</${component}>
</#macro>
```
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
pnpm install
pnpm build
2021-07-05 11:40:00 +00:00
```