@Media query in addon custom CSS - Forum | JoomShaper
Solved SP Page Builder

@Media query in addon custom CSS

Asked by Rakesh 3 years ago Last activity 3 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.

Accepted answer

Marked as the solution
Paul Frankowski Senior Staff

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

4 more replies

Pavel
3 years ago · edited

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.

Rakesh Asked this

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.

Rakesh Asked this

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.

Rakesh Asked this

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

Log in to reply.