-
Hey Generate team,
After updating to GB 2.1, the page editor is no longer full-width.
I’ve included before and after images in the private info for demonstration.To clarify, my sites all have a Layout Element with Content set to ‘Full Width (No padding)’.
As expected, the page editor UI is thus usually full-width, as in the before image.After the update, it’s being limited by the global container max-width:
body .wp-block { max-width: var(--content-width); }
and
html :where(.wp-block) { max-width: 840px;
How can I revert it to the previous behavior, so that the editor is full-width when the content layout is set to full-width (no padding)?
Thanks kindly
(Also, the new 2.1 features are absolutely fantastic – thanks as always!)
-
Alvind
Hi there,
This could be a bug. If you switch to mobile view and then back to desktop view in the editor, does the desktop width appear as expected (full width)?
-
Hi Alvind,
Great idea! Swapping to mobile view and back to desktop made the editor full-width again.
Great to know there’s a workaround for the time being – looking forward to the bugfix. Thanks in advance!
-
Alvind
Glad to hear that! I’ll raise an issue for this so it can be patched. Thanks for the information.
-
Stefanie
Hi FY
Also, the new 2.1 features are absolutely fantastic
I would be very grateful if you could tell me which new features you mean.
Thank you! -
I would be very grateful if you could tell me which new features you mean.
Thank you!I’m really enjoying the new styles dot-indicator system – just a general improvement on the block options/controls that makes it much easier to understand what’s going on with my styles at a quick glance.
The improved editor performance is also noticeable. Also very happy to see that nested Accordion blocks are fixed.
Here’s the full changelog: https://generatepress.com/category/changelog/
And here’s the blog post diving into the changes: https://generatepress.com/introducing-generateblocks-2-1/ -
Stefanie
Thank you!!
And here’s the blog post diving into the changes: …
Thank you so much, I hadn’t even read that! It’s a shame that GP’s blog posts are so hidden!
-
Sorry for the inconvenience here! We’ll be releasing a GP Premium fix on Monday to fix this.
For now (until GP Premium 2.5.3), you can use this function:
add_action( 'enqueue_block_editor_assets', function() { global $generate_elements; if ( ! is_array( $generate_elements ) ) { $generate_elements = array(); } $layout_element = array_filter( $generate_elements, function( $element ) { return $element['type'] === 'layout'; } ); $layout_element = array_values( $layout_element ); if ( ! isset( $layout_element[0]['id'] ) ) { return; } $id = $layout_element[0]['id']; $content_area = get_post_meta( $id, '_generate_content_area', true ); $content_width = get_post_meta( $id, '_generate_content_width', true ); $content_width_value = ''; if ( 'full-width' === $content_area ) { $content_width_value = '100%'; } if ( $content_width ) { $content_width_value = absint( $content_width ) . 'px'; } if ( $content_width_value ) { wp_add_inline_style( 'generate-block-editor', '.editor-styles-wrapper {--content-width: ' . $content_width_value . ';}' ); } }, 50 );
-
Thanks for that, Tom! Really appreciate it. Will keep an eye out for 2.5.3 also.
-
No problem! GP Premium 2.5.3 has been released, so you can remove the above function once you’ve updated.
Thanks for reporting the issue!
- You must be logged in to reply to this topic.