Skip to content

WordPress Developer Hours - Styling blocks

Photo of Michael Burridge
Hosted By
Michael B. and 2 others
WordPress Developer Hours - Styling blocks

Details

WordPress Developer Hours are held regularly on the last Wednesday of each month at 15:00UTC.

Styling blocks: enabling users with CSS custom properties

It's important to not be too prescriptive when developing blocks, and to allow users to have as much control as possible over the look and feel of the block on their websites.

In this month's edition of WordPress Developer Hours we're going to be talking about CSS custom properties (also known as CSS variables) and looking at how you can leverage them in blocks to give users more control over the styling and presentation of their sites.

First up, Michael will present a solution to a common problem, i.e. how to allow users to have control over the styling of inner elements in blocks which have complex markup. While it's relatively simple to allow users to style a block at the root level, this presentation looks at how you can assign the values stored in block attributes to CSS custom properties and use them to apply user-defined styling to sub-elements in both static and dynamic blocks.

Then, for the second presentation of the session, Justin will show you how to integrate CSS custom properties into your block stylesheets that play nicely with themes. The technique used integrates block plugins and *theme.json* while still giving preference to user choice.

After each presentation there will be the opportunity to ask any questions you may have, which Michael and Justin will be more than happy to answer.

Whether you're just starting out with block development or have built dozens of blocks already, this WordPress Developer Hours session is for you, and you're sure to learn a ton.

Photo of Learn WordPress Online Workshops group
Learn WordPress Online Workshops
See more events