{"id":376813,"date":"2023-01-31T07:43:43","date_gmt":"2023-01-31T15:43:43","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=376813"},"modified":"2023-03-01T06:48:09","modified_gmt":"2023-03-01T14:48:09","slug":"wordpress-block-theme-guide","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/wordpress-block-theme-guide\/","title":{"rendered":"WordPress Block Themes CSS and Style Settings Guide"},"content":{"rendered":"\n

In the 2015 State of the World address, WordPress co-creator Matt Mullenweg<\/a> famously directed the WordPress community to“Learn JavaScript deeply”<\/a>. He set that expectation upfront because he wanted everyone to know that JavaScript would be essential to the future of WordPress, which was paving a path toward full-site editing with a React-based editing experience to be called the Block Editor.<\/p>\n\n\n\n

That was years ago, and a concerted effort has been taking place to shift WordPress theme development from “classic\u201d PHP-based templating to a more modular, component-driven model centered on “blocks\u201d for constructing page and post layouts.<\/p>\n\n\n\n

Now that we\u2019re starting to see new block-based WordPress themes<\/a> hit the Theme Directory, many of us who have been developing WordPress themes for years using “classic\u201d PHP templates we\u2019re sitting in some sort of middle-ground between “classic\u201d and “block\u201d themes. Geoff expanded on this feeling in another post<\/a>, but the general sentiment is that working in WordPress is much different than before.<\/p>\n\n\n\n

Where do you even start on a WordPress Block Theme project? That\u2019s what this guide is all about. We could get into the nuances of working with React, but there\u2019s already a good guide for that here on CSS-Tricks<\/a> as well as tutorials on working with blocks<\/a>.<\/p>\n\n\n\n

Instead, this guide is geared toward block themes and how to configure them.<\/strong> Think of it as an extension to my previous article on managing styles in WordPress block themes<\/a>. In there, we covered how to define CSS styles in the theme.json<\/code> file \u2014 the foundation of all WordPress block themes, akin to how style.css<\/code> is used in classic themes. We\u2019re going to go deeper in this series, giving theme.json<\/code> a proper introduction and documenting how it\u2019s used to manage the appearance of a WordPress site that fully supports full-site editing features.<\/p>\n\n\n\n\n\n\n\n

As it currently stands, finding resources and proper documentation for defining and managing styles in WordPress block themes is a task in and of itself. Unless you keep up with GitHub issues<\/a>, Gutenberg plugin releases<\/a>, and Make WordPress Core<\/a>, you could feel lost in this new WordPress landscape. The WordPress Handbook<\/a> won\u2019t save you either because it is constantly several steps behind the breakneck speed of development.<\/p>\n\n\n\n

So, let\u2019s pull all of that together and learn about managing styles in WordPress block themes.<\/p>\n\n\n\n

WordPress Block Theme CSS and Style Settings Guide<\/h4>\n\n\n