Share common resources (images and fonts) between theme types (login and account)

I’ve got a custom theme for keycloak for the login and the account pages.

I inherit the keycloak theme and make changes to that in

Where I’ve set parent=keycloak.

I want to share resources (fonts and images) across both the login and account themes.

I see that in the keycloak theme there is a themes/keycloak/common thats used to share resources.

So I attempted the same method by creating

However when i attempt to share resources between my custom themes by setting the stylesCommon attribute in i receive a MIME type error (indicating that the file can’t be found). I’ve attempted to add import=common/mytheme in and this didn’t fix the issue.

Could anyone please point me to a working example of a custom theme, inheriting from keycloak, sharing resources between theme types?

Thank you, any help will be much appreciated.

1 Like

It sounds like you’re doing the right thing.

For example, if you have a css file in theme/mytheme/common/resources/css/my.css that you want to use in one of your themes, the in yourtheme should include:



it doesn’t work :frowning: I have an error 500. Anyone have an idea ?

my structure

│   └── keycloak-themes.json
└── theme/
    └── my-custom-theme/
        ├── account/
        │   ├── *.ftl
        │   └──
        ├── common/
        │   └── resources/
        │       └── css/
        │           └── bootstrap.min.css
        └── login

and my (login)


# -- which I already tried 
# by default keycloak use common/keycloak 
# (but how to change to my own common resources ? 
# I tried this import=common/my-custom-theme but I have an error 500)
stylesCommon=css/bootstrap.min.css (it's bootstrap file of keycloak (3.4.1 :/)

Where is the import in your

import=common/my-custom-theme (I tried this but I have an internal server error)


Do you have a public repo I/we can fork and test on? I’ve got something similar working, but without seeing your full setup, I can’t be sure it will work the same way.

Was this ever figured out? I am running into the exact same issue.

1 Like

Nope. the problem is not yet solved

I got it running by adding the theme type ‘common’ to the custom theme in the keycloak-themes.json.

"themes": [
        "name": "client",
        "types": [