Archived topic
Different mobile breakpoints in GP vs. GB?
3 replies · Started by Lilo on May 19, 2021
Hey, is it possible that in GP 768px wide devices belong to mobile, while in GB they belong to tablets? I'm having an Issue with margins set in block templates on GB container blocks, they don't apply to the classic iPad size of 768px for some reason, but do apply @ 767px and lower. I have sidebars for tablet layouts ( 769px and up in GP), and the disparity between GB and GP seems to be the issue here.
Hi there,
We have a filter for that.
Example:
add_action( 'wp', function() {
add_filter( 'generateblocks_media_query', function( $query ) {
$query['desktop'] = '(min-width: 1025px)';
$query['tablet'] = '(max-width: 1024px)';
$query['tablet_only'] = '(max-width: 1024px) and (min-width: 769px)';
$query['mobile'] = '(max-width: 768px)';
return $query;
} );
}, 20 );
Change the values to your preference. Make sure you regenerate your CSS after activating this PHP snippet to the actual CSS gets adjusted.
Thanks!
No problem. :D