Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

GB Pro – Changing breakpoints doesn’t work for global styles

  • Hi, I’ve been using global styles, and I noticed something was off when testing mobile. Some things break on 1120 and others on 1024. I found out that even though I set GB to have 1120 in the Settings, this did not affect global styles. So all my global styles were breaking at the wrong time.

    I searched around and found this function that I used in my functions.php. This is the version that I currently have right now:

    add_filter( 'generateblocks_media_query', function( $query ) {
        $query["desktop"] = "(min-width: 1120px)";
        $query["desktop_tablet"] = "(min-width: 768px)";
        $query["tablet"] = "(max-width: 1119px)";
        $query["tablet_only"] = "(max-width: 1119px) and (min-width: 768px)";
        $query["mobile"] = "(max-width: 767px)";
        return $query;
    } );

    It does not work. My global styles still have wrong breakpoints. Any thoughts?

  • Hi there,

    In the global style, you have the option to change the media query rule:

    We currently do not have a filter to mass change the media query for global style, but we are planning to add it.

  • Thank you that was very helpful. I hope the mass change for global media query is added soon

  • You are welcome   🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.