White background for Lightbox with SVGs?

Hi all,
is there a way to control or set white background for Lightbox when showing SVG transparent images?
I have a gallery with mixed jpgs and svgs and svg are transparent on dark background…

Thank you for your help.
Simon

Got a URL to share where you want to set this up?

I have the installation on local but I did an example to test here:
https://anfilov-web.cz/gallery-demo/

The logo in the middle is SVG. What I need is white in the background of SVG images or white Lightbox completely. Frankly, I have no idea how to solve it…

Thanks for any help. Simon.

Maybe this can help:

@Anfilov

Answer:

.pswp__img[src$=“.svg”]
{
background: red;
}

Result

This will only change the svg background, not png or jpg and so on.

You can put any background you like, the red is for example only.

This will change the background to all the photos, I think he wants only the background of svgs to change but it was a good idea.

Wow! Guys, you are all AWESOME. Thanks a lot.

This is cool!!! Thanks! However the transparency sucks. Do you have any idea, where you can control the transparency of Lightbox?

Hi,
thanks… I tried that script in custom CSS on the Gallery element, but it doesn’t work. I’m weak with code so maybe I’m doing something wrong. Do I change .psep_img for another string?

Well, can you give me access to check it out?

I’m sending you screenshot. Do I do it right?

I think so, do me a favor and write that yourself instead of copy-paste, check after that.

Can’t write code, sorry. Thanks anyway…

Allright. You were right. The problem was in " vs ” … thanks for your solution. It really works like a charm. First I thought you want me to write it myself as to work it somehow out… Used chat GPT to correct me the strings…
Thanks again…

1 Like

Yeah, there is something about copy-paste from the forum, I can’t see any difference but if you copy-paste from the forum it does not seem to work, I’ve done some tests and if I write it myself in bricks, it works like a charm.

Happy to help.