Need help developing a custom WordPress block with supports styles only applying to certain html elements

[ad_1]

Hello! I am working on developing a WordPress plugin, and a part of my plugin is a custom block. I am familiar with block development, but one thing has been tripping me up. If you look at the default WordPress search block, it uses the block supports features, like background color, text color, border, font size, etc. But, it only applies them to certain elements in the block (like background color to the bg of the button, or font size to the text of the label, etc.), and excludes the others. I am trying to emulate this in my block, and I absolutely cannot find any way to implement it. My block is a server-rendered block using the `render.php` file. I know about the `get_block_wrapper_attributes();` function, but that just returns a list of attrs to apply to the container. How to do it properly in the `edit.js` file would also be much appreciated. I would be grateful for any help the WordPress developers in this community can offer!

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer