Approaches to creating a block style
There are two approaches to add styles. Let’s review them now. As stated previously, you can use either PHP or JavaScript – which you use is entirely up to you. The examples in this book use a mixture of both for demonstration purposes. It’s worth learning both and each has its merits typically based on what you want to achieve with a given theme style, but today a lot of themes use PHP, so let’s start with that.
Along with these two languages, there are two approaches: one of declaring inline styling in the function for the block style, and another to have the function call a class inline. We are going to explore both.
Custom block style using PHP with inline CSS
Let’s begin by looking at the function we are using:
register_block_style() PHP function:
https://developer.wordpress.org/reference/functions/register_block_style/
The format for this is as follows:
register_block_style( ...