You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the right way to add images, whether to be referenced as an image tag or in CSS? For example, as a background image in the case of CSS or a logo in the page.
For the background I am looking at the documentation, but I am still a little confused, being a tailwind newbie. I suspect the path would be ../images/myimage.png if the image is in a sister folder to the CSS, but I am still not sure on the right entry.
For an img tag I've worked around it by putting the image on another server as accessing by an absolute URL, but ideally I'd like the image to be local to the theme. I've looked at the Keycloak documentation, I am still confused.
Edit: for the last one, it would seem to be (see here), but will need to test later:
<imgsrc="${url.resourcesPath}/img/sample.png" />
The text was updated successfully, but these errors were encountered:
I am not a tailwind expert. Here's what I am done, but may not the best way.
First put your image to theme/mytheme/login/resources/imgs/myimage.png
Just edit theme/mytheme/login/components/atoms/body.ftl
Add a style in the body. style="background-image: url('${url.resourcesPath}/imgs/myimage.png')"
Here is the body.ftl file may looks like:
You can change the body class to change size or attachment if you want, just check the tailwind document
After saving the file, just run the build command. pnpm build
And replace the themes. Done.
Hope this helps
What is the right way to add images, whether to be referenced as an image tag or in CSS? For example, as a background image in the case of CSS or a logo in the page.
For the background I am looking at the documentation, but I am still a little confused, being a tailwind newbie. I suspect the path would be
../images/myimage.png
if the image is in a sister folder to the CSS, but I am still not sure on the right entry.For an
img
tag I've worked around it by putting the image on another server as accessing by an absolute URL, but ideally I'd like the image to be local to the theme. I've looked at the Keycloak documentation, I am still confused.Edit: for the last one, it would seem to be (see here), but will need to test later:
The text was updated successfully, but these errors were encountered: