TLDR: This is just a general purpose tutorial on how to import fonts in a web project.
If you already know how to do it you can skip this page since there is nothing specific to Keycloakify about importing fonts. You can import them just as you would in any other web project.
Only, if you import the your fonts in the index.html don't forget to import them as well in .storybook/preview-head.html for Storybook.
Then all we have to do is apply the Font font family, in this example we will use vanilla CSS but you can of course use your favorite styling solution.
src/login/main.css
.kcHeaderWrapperClass {/* NOTE: We would use `body {` if we'd like the font to be applied to everything. */font-family:"Playwrite NL", cursive;}
src/login/styles.css
.kcHeaderWrapperClass {/* NOTE: We would use `body {` if we'd like the font to be applied to everything. */font-family:"Playwrite NL", cursive;}I
Keycloak is often used in enterprise internal network with strict network traffic control. In this context, using a Font CDN isn't an option, you want the font to be bundled in your jar and served directly by the Keycloak server.
Let's see how we would use a self hosted copy Vercel's Geist font.
First let's download and extract the font files in src/login/assets/fonts/geist/: