developer-blog-content icon indicating copy to clipboard operation
developer-blog-content copied to clipboard

Using the Grid layout type for theme creators

Open bph opened this issue 2 years ago • 9 comments

Discussed in https://github.com/WordPress/developer-blog-content/discussions/94

Originally posted by justintadlock April 4, 2023 Gutenberg 15.5 is introducing a new Grid layout type: https://github.com/WordPress/gutenberg/pull/49018

Currently, it's usable as an experimental Group block feature: https://github.com/WordPress/gutenberg/pull/49359

Once this is out of the experimental state, this will be a major layout feature for theme authors, and they'll need to know how to build with it. This is still early in development, so it'll be a while before it's ready for any sort of docs/tutorials. But, I wanted to go ahead and note it for a future post.

I'm super excited about this because I've just been wanting to build something like this layout for two years now with proper layout support instead of hacking Columns to make it happen:

gb-gallery-w-quote

bph avatar Jan 31 '24 17:01 bph

Because the Grid variation has never landed in core for the Group block, I wanted to tackle this from a different angle.

First, technically, grid support is available to any block (or variation) that opts into it. So, the primary purpose of the post will be showing developers how to enable it in a forward-compatible way for the Group. Basically, creating their own Grid variation.

But this post could also potentially how block developers can enable it for their own blocks.

justintadlock avatar Jan 31 '24 18:01 justintadlock

I will draft this here: https://docs.google.com/document/d/1IBogXvaZygADpiTfJ3sMhaWsG74434j42CEOGTZYHFQ/edit?usp=sharing

justintadlock avatar Jan 31 '24 19:01 justintadlock

This one is ready for its first review: https://docs.google.com/document/d/1IBogXvaZygADpiTfJ3sMhaWsG74434j42CEOGTZYHFQ/edit?usp=sharing

justintadlock avatar Feb 02 '24 19:02 justintadlock

Thanks to @ndiego for the first pass on this.

justintadlock avatar Feb 02 '24 20:02 justintadlock

@justintadlock, I left a couple of very minor suggestions. Otherwise, the post looks great to me. At first, I had questions about using upper or lower case in "grid," but I see that it follows a consistency when it has been capitalized.

rmartinezduque avatar Feb 06 '24 12:02 rmartinezduque

Yeah, the uppercase use should specifically be the named variation and lowercase when talking about the CSS feature.

justintadlock avatar Feb 06 '24 14:02 justintadlock

I am happy to report that—after nearly a year—this post is finally published! 🥂

Social copy:

Did you know that WordPress has built-in grid support? Learn how to enable it in your WordPress themes and build even more amazing layouts!

https://developer.wordpress.org/news/2024/01/29/how-to-disable-specific-blocks-in-wordpress/

justintadlock avatar Feb 06 '24 19:02 justintadlock

scheduled on social for 2/29 or so.

bph avatar Feb 13 '24 13:02 bph

Did you know that WordPress has built-in grid support? Learn how to enable it in your WordPress themes and build even more amazing layouts! https://developer.wordpress.org/news/2024/01/29/how-to-disable-specific-blocks-in-wordpress/

@justintadlock, should the link be this instead? https://developer.wordpress.org/news/2024/02/06/adding-and-using-grid-support-in-wordpress-themes/

bhdd avatar Jun 19 '24 18:06 bhdd