.css, .sass or .less
Let's see, as an example, the different ways you have to change the backgrounds image of the login page.
First let's download a background image an put it in our public directory:

Let's apply this image to the body using plain CSS
body.kcBodyClass {
background: url(/background.png) no-repeat center center fixed;
}We import the StyleSheet:
import "./main.css";
import { Suspense, lazy } from "react";
// ...Result (see testing your theme):

If you prefer, you can also move the background.png image from public/ to, for examples, src/login/assets/background.png and reference the image with a path relative to the CSS file, in this case it would be:
body.kcBodyClass {
background: url(./assets/background.png) no-repeat center center fixed;
}In the following video I show how to load different background for different page and how to create theme variant.
Last updated
Was this helpful?
