{"id":109,"date":"2023-07-29T09:54:54","date_gmt":"2023-07-29T12:54:54","guid":{"rendered":"https:\/\/kylekelly.com\/?p=109"},"modified":"2023-07-29T12:18:10","modified_gmt":"2023-07-29T15:18:10","slug":"building-customizable-wordpress-blocks","status":"publish","type":"post","link":"https:\/\/kylekelly.com\/posts\/building-customizable-wordpress-blocks\/","title":{"rendered":"Building customizable WordPress blocks"},"content":{"rendered":"\n

This is a fantastic video that just came out on working on WordPress blocks and themes:<\/p>\n\n\n\n

https:\/\/www.youtube.com\/watch?v=KreJC3aB0q4<\/a><\/p>\n\n\n\n

The first topic by Michael Burridge is on how to give users control over styling the content of your block, not just the wrapper.<\/p>\n\n\n\n

This can be done by using CSS custom properties and passing a styles object that combines them with block attributes:<\/p>\n\n\n\n

\"A<\/figure>\n\n\n\n

The second by Justin Tadlock is on how to build your custom block in such as way that theme designers can use theme.json to style your block.<\/p>\n\n\n\n

This can be done by setting values in settings.custom in theme.json which are then turned into CSS custom properties you can use in your block styling. A future theme designer can then override them in their own theme.<\/p>\n\n\n\n

\"A<\/figure>\n\n\n\n

I think I’ll be combining these two techniques going forward.<\/p>\n","protected":false},"excerpt":{"rendered":"

This is a fantastic video that just came out on working on WordPress blocks and themes: https:\/\/www.youtube.com\/watch?v=KreJC3aB0q4 The first topic by Michael Burridge is on how to give users control over styling the content of your block, not just the wrapper. This can be done by using CSS custom properties and passing a styles object […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[9],"_links":{"self":[{"href":"https:\/\/kylekelly.com\/wp-json\/wp\/v2\/posts\/109"}],"collection":[{"href":"https:\/\/kylekelly.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kylekelly.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kylekelly.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kylekelly.com\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":5,"href":"https:\/\/kylekelly.com\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":116,"href":"https:\/\/kylekelly.com\/wp-json\/wp\/v2\/posts\/109\/revisions\/116"}],"wp:attachment":[{"href":"https:\/\/kylekelly.com\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kylekelly.com\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kylekelly.com\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}