{"id":374910,"date":"2022-11-07T06:05:11","date_gmt":"2022-11-07T14:05:11","guid":{"rendered":"https:\/\/css-tricks.com\/?p=374910"},"modified":"2024-05-01T10:38:17","modified_gmt":"2024-05-01T17:38:17","slug":"managing-css-styles-in-a-wordpress-block-theme","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/managing-css-styles-in-a-wordpress-block-theme\/","title":{"rendered":"Managing CSS Styles in a WordPress Block Theme"},"content":{"rendered":"\n

The way we write CSS for WordPress themes is in the midst of sweeping changes. I recently shared a technique for adding fluid type support in WordPress<\/a> by way of theme.json<\/code>, a new file that WordPress has been pushing hard<\/a> to become a central source of truth for defining styles in WordPress themes that support full-site editing (FSE) features.<\/p>\n\n\n\n

Wait, no style.css<\/code> file? We still have that. In fact, style.css<\/code> is still a required file<\/a> in block themes, though its role is greatly reduced to meta information used for registering the theme. That said, the fact is that theme.json<\/code> is still in active development, meaning we\u2019re in a transitional period where you might find styles defined there, in styles.css<\/code> or even at the block level.<\/p>\n\n\n\n

So, what does styling actually look like in these WordPress FSE days? That\u2019s what I want to cover in this article. There\u2019s a lack of documentation for styling block themes in the WordPress Theme Developer Handbook<\/a>, so everything we\u2019re covering here is what I\u2019ve gathered about where things currently are as well as discussions about the future of WordPress theming.<\/p>\n\n\n\n\n\n\n

The evolution of WordPress styles<\/h3>\n\n\n

The new developmental features that are included in WordPress 6.1<\/a> get us closer to a system of styles that are completely defined in theme.json<\/code>, but there is still be plenty of work to do before we can fully lean on it. One way we can get an idea of what\u2019s coming in future releases is by using the Gutenberg plugin<\/a>. This is where experimental features are often given a dry run.<\/p>\n\n\n\n

Another way we can get a feel for where we are is by looking at the evolution of default WordPress themes<\/a>. To date, there are three default themes that support full-site editing:<\/p>\n\n\n\n