
Add an icon to a heading
Block Enhancements adds powerful design options to core Gutenberg blocks, so you don’t need to install heavy custom block libraries.
It’s the easiest way to make your existing blocks more flexible and responsive while keeping your site fast and clean. All dynamic styles are rendered in the document head instead of inline styles. If you deactivate the plugin, all customized styles are removed, and no leftover styles will affect your site.
Unlike other similar plugins, this plugin is lightweight. It only loads what you need. You can enable or disable individual features per block type from the plugin’s settings page.
It works with all Gutenberg-ready themes, however, the with-icon feature uses the CSS pseudo ::before to add icons with the mask-image CSS property. It may conflict with other plugins or themes that use the same technique.
Responsive styles are applied per device mode: Desktop, Tablet, and Mobile. When you edit a style for a block for the first time, the current device mode becomes the source, and the other modes will automatically inherit those styles.
For example, if you set styles in Desktop mode first, Tablet and Mobile will inherit the Desktop styles by default. If you want different styles for Tablet or Mobile, switch to that mode and adjust the settings there. The same behavior applies if you start editing in Tablet or Mobile mode. Each device mode can be customized independently once it has been edited.
By default, the breakpoints are:
If your theme or another plugin uses different breakpoints, you can change the defaults using the following filter:
apply_filters( 'block_enhancements_get_breakpoints', [
'sm' => [
'breakpoint' => '576px',
'mediaQuery' => '',
],
'md' => [
'breakpoint' => '768px',
'mediaQuery' => '@media (min-width: 768px){##CONTENT##}',
],
'lg' => [
'breakpoint' => '1024px',
'mediaQuery' => '@media (min-width: 1024px){##CONTENT##}',
],
] );
This allows you to align responsive behavior with your theme’s breakpoint system.
How to customize a core button in Gutenberg:
Please help this plugin grow by reporting issues and giving suggestions.
If this plugin is useful for you, please do a quick review and rate it on WordPress.org to help us spread the word. I would very much appreciate it.
Please check out my other plugins if you’re interested:
The plugin is developed using @wordpress/scripts. The source code is available in the trunk branch.