Share css styles

I want to share common css styles such as fonts and root variables across all my styles.css files. I’m doing this because each css file starts with the same code. I tried creating a common folder, but it didn’t work for me. Does anyone have a solution for this? :slightly_smiling_face:

Here is my structure.

themes

theme-1
β”‚   β”œβ”€β”€ admin
β”‚   β”‚     β”œβ”€β”€ resources
β”‚   β”‚   β”‚   β”œβ”€β”€ assets
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ styles.css
β”‚   β”‚   └── theme.properties
β”‚   β”œβ”€β”€ account
β”‚   β”‚     β”œβ”€β”€ resources
β”‚   β”‚   β”‚   β”œβ”€β”€ assets
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ styles.css
β”‚   β”‚   └── theme.properties
β”‚   β”œβ”€β”€ login
β”‚   β”‚     β”œβ”€β”€ resources
β”‚   β”‚   β”‚   β”œβ”€β”€ assets
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ styles.css
β”‚   β”‚   └── theme.properties
β”‚   β”œβ”€β”€ common
β”‚   β”‚     β”œβ”€β”€ resources
β”‚   β”‚   β”‚   β”œβ”€β”€ assets
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ common.css
β”‚   β”‚

What does this mean? What was your expected behavior? What was the actual behavior? What did you configure/specify? Can you provide your theme.properties? And so on…

I expected the styling to apply as I that read on another post here.

I for example had tried this in my theme.properties

parent=keycloak.v3
styles=assets/styles.css
logo=/images/logo.svg
favIcon=/images/favicon.ico
stylesCommon=css/common.css

For account and admin theme this is more-or-less tricky to not convenient possible, due to the fact that these are (more-or-less) complete independent React apps.

For login theme you have to specify additionally common=common/theme-1 in the properties file. Then, you can reference the common style resources via stylesCommon=assets/common.css.
(BTW: you have in your folder structure the assets folder but in your theme.properties excerpt the css folder!? That doesn’t make sense…)