Normal view
- Gutenberg Times Podcast
- Gutenberg Changelog #63 – Block Pattern Directory, WebFonts API and Gutenberg 12.8
Gutenberg Changelog #63 – Block Pattern Directory, WebFonts API and Gutenberg 12.8
- Gutenberg Times Podcast
- Gutenberg Changelog #62 – Gutenberg 12.7, a New Call for Testing, the Web Fonts API Arrival
Gutenberg Changelog #62 – Gutenberg 12.7, a New Call for Testing, the Web Fonts API Arrival
Block Theme Building Tips
When building block themes there is often more than one way to achieve the same thing. It’s often not clear which of these options is preferable. Below I outline some tips and guidelines that I find helpful. The guiding principle here is to remove as much complexity as possible from the theme; instead block themes should be using the affordances provided by Gutenberg.
1. Avoid using CSS
As much as possible, block themes should avoid providing CSS. Gutenberg increasingly offers design tools which allow theme builder to control the design of the theme without using CSS. If it is not possible to achieve a particular design without CSS please create an issue for it on Gutenberg so we can consider adding a design tool to achieve the design.
2. Reuse patterns rather than implementing custom templates
As the number of block themes we build grows we will have an ever increasing number of templates and template parts in each theme. In practice there are a small number of patterns which can be reused on many themes. We should be aiming to reuse existing patterns rather than implementing new templates. This means we need clever patterns which are able to reuse settings from theme.json.
3. Prefer theme.json to block settings
Connected to the point above, when we want to change the appearance of a block in a template or a pattern it is usually better to do so in the theme.json file than in the block template. This means that the design will be used for all instances of the block, not just the edited instance. It also keeps templates design agnostic, so that they be reused (see above).
What other tips do you have for building block themes?

- Gutenberg Times Podcast
- Gutenberg Changelog #61 – Gutenberg 12.6, Planning for WordPress 6.0 and Universal Blocks
Gutenberg Changelog #61 – Gutenberg 12.6, Planning for WordPress 6.0 and Universal Blocks
- Gutenberg Times Podcast
- Gutenberg Changelog #60 – Restricting Customization in a Full-Site Editing World, Gutenberg 12.5 and Roadmap for WordPress 6.0
Gutenberg Changelog #60 – Restricting Customization in a Full-Site Editing World, Gutenberg 12.5 and Roadmap for WordPress 6.0
- Gutenberg Times Podcast
- Gutenberg Changelog #59 – Gutenberg 12.4, Developer Hours, Extensibility of the Block Editor and more
Gutenberg Changelog #59 – Gutenberg 12.4, Developer Hours, Extensibility of the Block Editor and more
- Gutenberg Times Podcast
- Gutenberg Changelog #58 – Gutenberg 12.2 and 12.3, WordPress 5.9 RC and DevNotes for Full-Site Editing and Block Themes
Gutenberg Changelog #58 – Gutenberg 12.2 and 12.3, WordPress 5.9 RC and DevNotes for Full-Site Editing and Block Themes
- Gutenberg Times Podcast
- Gutenberg Changelog #57 – Gutenberg 12.1, Block Theme.json Builder, WordPress 5.9 Beta 2
Gutenberg Changelog #57 – Gutenberg 12.1, Block Theme.json Builder, WordPress 5.9 Beta 2
- Gutenberg Times Podcast
- Gutenberg Changelog #56 – Gutenberg 12.0, WordPress 5.9 Release Schedule, Navigation Block and Site Editor
Gutenberg Changelog #56 – Gutenberg 12.0, WordPress 5.9 Release Schedule, Navigation Block and Site Editor
Create A Blockbase Child Theme
We have been working on a plugin to help you create a Blockbase child theme. The idea is that you can use the existing tools to make changes to a Blockbase theme, and then export a bundle of templates and theme.json as a new child theme.
I tried to create a new theme called “Typewriter” using these tools.
Step 1 – Setup
Install and activate Blockbase , and the Create Blockbase Theme plugin.
Step 2 – Global Styles
Make changes to your site using the Global Styles editor. First I chose some new colors:

You can also use the Global Styles editor to update Typography and Layout settings:

Then I changed the fonts, using the Customizer:

I made all my changes using the Global Styles editor and the Customizer, but you might want to make more changes directly to the theme.json file after the theme is created.
Step 3 – Templates
Edit your templates using the Site Editor:

I managed to achieve everything I needed to in this theme using the Site Editor, but for some things you might need to edit the template files directly once the theme is created.
Step 4 – Export
Under Appearance there will be a new page called “Create Blockbase Theme”:

You can add the details for the theme here. These will be used in the style.css file. When you click the “Create Blockbase Theme” button, a zip file will be downloaded, which contains all the files for your theme. Here’s mine:
Step 5 – Test
At this point you should have a zip file containing a working theme. You can upload this to your WordPress and activate it.
The theme contains an screenshot file, which you will need to update manually.
Now when you look at the frontend of your site it should look the same as it did before you activated the new theme. Here’s my new theme:


Further changes
Once the theme has been created you can unzip the theme zip file and make further changes to the theme files. This might be necessary to make more advanced changes to the theme. You can:
- Modify and add configuration in the theme.json file.
- Update the html template files in
block-templatesandblock-template-parts - Add custom CSS to the file in
assets/theme.css
Feedback
We’d love you to try this new tool and let us know how you get on in the comments!

Gutenberg Changelog #55 – Gutenberg 11.9, WordPress 5.9, Navigation Block
- Gutenberg Times Podcast
- Changelog #54 – Gutenberg 11.8-Navigation Block, Full-site Editing and the Plugin Machine
Changelog #54 – Gutenberg 11.8-Navigation Block, Full-site Editing and the Plugin Machine
- Gutenberg Times Podcast
- Changelog #53 – WordPress 5.9 Go/No Go decision, Gutenberg releases 11.6 and 11.7, and Themes and Styles for the Editor
Changelog #53 – WordPress 5.9 Go/No Go decision, Gutenberg releases 11.6 and 11.7, and Themes and Styles for the Editor
Universal Themes
Since our last post about Universal Themes we have fleshed out this idea and are using it to build all our themes.
The Problem
WordPress is introducing the Full Site Editor and with it new ways to build themes. These themes are called “Block” themes and integrate deeply with Gutenberg Blocks. These types of themes require the use of the new (and still in development) Full Site Editor.
The Site Editor is still being built, and block themes are in a nascent stage; they don’t yet offer the full gamut of features that will be available in the future. Block themes also require a very recent version of WordPress. How can we build themes which work with the classic dashboard to today and will continue to work with the Site Editor when it is more fully featured? This is the problem Universal themes are seeking to solve.
What is a Universal Theme?
Universal themes are an attempt to bridge the gap between the classic themes and block themes, by adding some layers to a block theme to make it work.
A Universal theme is a block theme that can use the Full Site Editor but can also be configured in a more classic way. That means that you can use classic WordPress tools, like the Customizer, Menus and Widgets dashboards as well as the Site Editor.
Templates
Block themes load templates from the block-templates directory. However classic themes load them from the root. To ensure that we don’t end up duplicating code and that users can move between the Classic Dashboard and the Site Editor, we use the function gutenberg_block_template_part inside our classic templates. For example header.php:
<header class="wp-block-template-part">
<?php echo gutenberg_block_template_part( 'header' ); ?>
</header>
Internationalization
Because block themes use html templates, its not possible to translate any copy inside them. In most cases we can avoid putting copy inside our templates, but there are some cases where it is impossible, for example the 404 page.
In these cases we are simply providing a classic template instead of a block template so that the strings can be translated. We can avoid any issues of code duplication by using the approach described above for templates. Here’s the 404.php from Blockbase:
<?php
/**
* The template for displaying 404 pages (not found)
*
* @package Blockbase
* @since 1.1.1
*/
get_header();
?>
<main class="container-404">
<h1 class="has-text-align-center has-medium-font-size"><?php _e( 'Oops! That page can’t be found.', 'blockbase' ); ?></h1>
<p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'blockbase' ); ?></p>
<?php echo do_blocks('<!-- wp:search {"label":""} /-->'); ?>
</main>
<?php
get_footer();
Fonts & Colors
Global Styles allows themes to customize their font and color options via theme.json. This gives universal themes a way to modify the fonts and colors in a theme, by modifying theme.json. In Blockbase we have attached some hooks to the font and color controls in the Customizer so that when you modify them the changes are made in theme.json. This gives us a single source of truth for these settings.
Blockbase
We have created a universal theme called Blockbase, which can be used as a parent theme; any child themes created with Blockbase will automatically be universal themes. You can learn more about Blockbase at blockbasetheme.com.
Coda
Universal themes are a temporary measure. As the Site Editor continues to improve and more features are added, the need for universal themes will diminish. These wrappers will be made obsolete and in time universal themes will become block themes.

- Gutenberg Times Podcast
- Changelog #52 -Planning, Scope and Team for WordPress 5.9, Roadmap for WooCommerce Blocks and Gutenberg 11.5
Changelog #52 -Planning, Scope and Team for WordPress 5.9, Roadmap for WooCommerce Blocks and Gutenberg 11.5
- Gutenberg Times Podcast
- Changelog #51 – Automattic Becomes a Sponsor, new Gallery Block, Theme.json, and Gutenberg 11.4 Release
Changelog #51 – Automattic Becomes a Sponsor, new Gallery Block, Theme.json, and Gutenberg 11.4 Release
- Gutenberg Times Podcast
- Changelog #50 – Preliminary Roadmap to WordPress 5.9, Gutenberg 11.3 release and Navigation Screen and Block
Changelog #50 – Preliminary Roadmap to WordPress 5.9, Gutenberg 11.3 release and Navigation Screen and Block
- Gutenberg Times Podcast
- Changelog #49 – Gutenberg 11.2, Drag and Drop, Flex Layout, Core Data Shortcuts and Modern WordPress Development
Changelog #49 – Gutenberg 11.2, Drag and Drop, Flex Layout, Core Data Shortcuts and Modern WordPress Development
- Gutenberg Times Podcast
- Changelog #48 – WordPress 5.8 Release, WordPress Pattern Directory and Gutenberg 11.1
