Breakpoints GP-GB-WP

  • hi there,

    i am constantly stumbling over the breakpoints-thing whilst diving more and more into GenerateBlocks.
    GeneratePress has its given breakpoints, which are picked up by GB. thats fine so far.
    one can tweak breakpoints in GB on a per block basis. o.k. for that, but only partly satisfying 😉

    BUT:
    1st – theres no option (via GP occasionally) to set custom breakpoints or add another one globally.
    so the question would be: ist there anything planned to change this?

    2nd – kind of a bummer to me: the breakpoints in the WP block editor are significantly different from the ones in GP and GB, what makes it sort of a fiddling work at times finding the right (or desired) behaviour.

    So the big question behind that would be: is there any possible way to get that all synced?
    at the end it possibly seems to be a question of changing the breakpoints within the block editor itself as they are a bit … well, they dont seem to be the best decision 🙂
    any known way to change them?

    or any other way to get this sorted out and make it sync?

    thanks in advance for any hint.

  • Hi there,

    The GeneratePress Theme uses a mixture of static break points and dynamic breakpoints
    The static breaks are in the main.css stylesheet and are baked in for the hide-on-* utility classes and setting the position of the Sidebar on mobile ( @ Max Width 768px ). If those need adjusting you would require custom CSS to do so,

    The dynamic breaks are for cutomzier settings, such as where the mobile menu appears or where to write style for typography. These breakpoints can be adjusted if need be using the following filters for tablet, mobile and mobile menu:

    
    add_action ('wp', function() {
    
        add_filter( 'generate_tablet_media_query', function( $query ) {
            return '(min-width: 992px) and (max-width: 1024px)';
        });
        add_filter( 'generate_mobile_media_query', function( $query ) {
          return '(max-width: 991px)';
        });
        add_filter( 'generate_mobile_menu_media_query', function( $query ) {
          return '(max-width: 991px)';
        });
    }, 20 );
    

    GenerateBlocks is also able to filter the default breaks:

    
    add_action ('wp', function() {
        add_filter( 'generateblocks_media_query', function( $query ) {
          $query['desktop'] = '(min-width: 1025px)';
          $query['tablet'] = '(max-width: 1024px)';
          $query['desktop_tablet'] = '(min-width: 992px)';
          $query['tablet_only'] = '(max-width: 1024px) and (min-width: 992px)';
          $query['mobile'] = '(max-width: 991px)';
    
          return $query;
        });
    }, 20 );
    

    Note that modifying these will only apply to new styles, it won’t update any existing CSS.

    WordPress core doesn’t do responsive controls , some most of what its blocks do is baked into the blocks styles and the only way to overcome that would be to use CSS.

    The Editor itself, we are limited in what we can do with the “preview” sizes matching actual device breakpoints too, but we do have some ideas to hijack that for better previewing when building with GenerateBlocks.

  • hi david,

    thanks beforehand and sorry for the late reply.

    fiddled around with this for a while. still sort of difficult to get it streamlined all the way.
    especially the different values for mobile in GP and GB… 768 vs 767 breakpoint for mobile.

    would appreciate it if the breakpoints were all the same between those two at least. any plans to do so?
    workaround so far to set the default breaks via code. still seems kind of ‘hacky’, as GB has more breakpoints – and GP navigation is another thing to conquer, which gives me slight headaches nearly every time ;). at least when trying to achive things with given settings in customizer.

    hijacking of WP preview would be appreciated as well – best case both customizer and editor.

    so far, thats the only thing pagebuilders are still more comfortable to work with imho. but as the GP/GB combo is getting more and more versatile whilst using the native editor this should be solved. (just my two cents on my way to get rid of those nasty overloaded builders…)

    eager to hear whats planned 🙂

    best regards

  • Hi there,

    A lot of the GP breakpoints are hard-coded in and difficult to change now without breaking existing sites.

    However, we are moving towards an ecosystem where everything is built with our blocks, so you won’t have to worry about syncing the two much longer.

    As for editor previews, I agree that this needs improving. It’s definitely on our list 🙂

  • hi tom,

    thanks for your reply. looking forward to every improvement.

    meanwhile your ‘ecosystem’ already is stunning and has massively improved.
    one of the best out there, if not ‘the’ best (to me at least). especially as its obviously driven by the thought of performance and true support throughout the team – not by max advertising and blingbling. you know what i mean 🙂

    keep up the great work.

  • That’s really great to hear! Thanks so much 🙂

    We’re just getting started!

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