How can i import a photo to use inside frontity in my css background-image?

How can i import a photo to use inside frontity in my css background-image?

I’ve been trying to get frontity to load an image as wallpaper which is in the src / Img / image.png path and I try to import it into frontity but it doesn’t recognize the path, does anyone know how to do it?

HI @jordi.lf.cb

Welcome to the Community.
You can import images directly from your js files. Any /\.(png|jpe?g|gif|svg)$/, files are accepted

So, the following should work:

import { styled } from "frontity";
import bgImage from "./assets/balloons.jpg"

const Content = styled.div`
    border: 1px solid #000;
    background-image: url(${bgImage});
    width: 2000px;
    height: 2000px;
`;

Hope this helps