Hugo Theme Stack - Background Image

I’m trying to add light/dark background images to the theme Stack (GitHub - CaiJimmy/hugo-theme-stack: Card-style Hugo theme designed for bloggers), but I couldn’t get my code to work right. Here is my code;

:root {
    --body-background: url("/background-white.png");
    &[data-scheme="dark"] {
        --body-background: url("/background-gray.png");
    }
}

I have tried different combinations of placing the images on assets or static and having the syntax be /assets/background-white.png or /background-white.png or /static/background-white.png.

At one point in time I took out the url and just have plain colors (yellow for light mode, blue for dark mode), and that worked… but then I tried it again a few hours later and now the plain colors code does not work.

Any help in this matter is greatly appreciated. Thanks.

problem solved. I just had my scss file in the wrong folder. :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.