Home>Support>Media Query for each custom widget

Media Query for each custom widget

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hello,

I’ve created custom widget called “spacer widget” to SiteOrigin.
I’ve added two inputs in widget’s form. One for dekstop height and second for mobile height.

I’d like to manipulate height property depending on media queries. One for desktop breakpoint and one for mobile breakpoint.

I ask for help how to do it or at least where should I look in order to achieve it foreach spacer widget.

Ps.: I think that I need:
1. store variables “widget_ID” and “mobile_height” from $instance variable in widget template.
2. In order to do this I need to add inline css in head section.

I greatly appreaciate all help.

Greetings

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 6 years, 2 months ago Alex S
    Hi, I Work Here

    Hi Pawel,

    You can dynamically apply media queries using LESS Styling functionality. As an example of this, we do this with the SiteOrigin Features widget to allow users to adjust the collapse point.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More