@Media Query In Addon Custom CSS - Question | JoomShaper
Black Friday sale is live with flat 50% OFF. Sale ends soon! Grab your deal now!

@Media Query In Addon Custom CSS

R

Rakesh

SP Page Builder 2 years ago

Looks like @Media queries do not work within addon custom css. Only in template custom css? Or am I missing something?

Addon Video Custom css: @media (max-width: 576px) {.sppb-addon-video {width:300px;height:auto;} }

Need to have difference sizes for the Video addon on different window sizes.

Help needed, thanks.

0
5 Answers
Pavel
Pavel
Accepted Answer
2 years ago #118383

Hi.

This does not work inside the addon, since the addon's ID will be added to this code in output.

Looks like #sp-addon-123456789 @media ....

Use custom.css FILE in template (not Custom CSS FIELD in template) for any your code. In this case, the whole code will be in one place and you can always edit it, instead of looking for a code in different parts of the system.

In addition, the use of the CSS field in Addon can create a lot of unnecessary code, which negatively affects performance.

0
R
Rakesh
Accepted Answer
2 years ago #118393

Thanks for clarifying. Still really like the custom css within the addon, it is awsome. It keeps the code only where required and not at the complete site, creating wrong results at the wrong place.

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 2 years ago #118398

If I may join....

Each Page has it's own Page CSS - where you can use CSS for that page only.

Screenshot from SPPB 5 beta3, but this same is inside SPPB 3.8, and 4.0.x info_1199_2023.jpg

0
R
Rakesh
Accepted Answer
2 years ago #118401

Ah yes ofcourse. I forgot about that option since the last SPPB versions it didn't save any content. Good reminder, will try it out.

0
R
Rakesh
Accepted Answer
2 years ago #118402

Worked perfectly, thanks. Would be good to have Video width options in SPPB 5, in px and %, alignment settings and screen size dependent.

0