Adds a gradient border style control to the WordPress block editor. Works with any theme that supplies gradient presets in theme.json.
- Adds a Gradient Border panel to the block inspector (Styles tab) for supported blocks.
- Applies
is-style-gradient-borderclass when a gradient is selected; removes it when cleared. - Injects
--border-gradientand--border-widthCSS custom properties server-side so the frontend renders without a flash of un-styled content. - Supported blocks (default):
core/columns,core/column,core/group,core/image,core/cover,core/media-text,core/post-terms,core/query-title. - Extend the supported block list with the
hm-block-gradient-border.supportedBlocksJavaScript filter.
- Download the latest release ZIP.
- Upload to
wp-content/plugins/or install via Plugins → Add New → Upload Plugin. - Activate the plugin.
Or via Composer:
composer require humanmade/hm-block-gradient-borderAdd more blocks before this plugin's JS loads:
wp.hooks.addFilter(
'hm-block-gradient-border.supportedBlocks',
'my-plugin/extend-gradient-border',
( blocks ) => [ ...blocks, 'core/heading' ]
);src/index.js— Editor extension: registers theborderGradientattribute and renders theGradientPickerpanel viaeditor.BlockEditandblocks.registerBlockTypefilters.src/view.scss— Frontend CSS:.is-style-gradient-border::afterwithmask-composite: excludeto draw the gradient ring.inc/render.php—render_blockfilter (priority 10): stamps--border-gradientand--border-widthonto the element's inline style.
npm install
npm run build # production build
npm run start # watch mode
npm run lint:js # lint JavaScript
npm run lint:css # lint CSS
npm run playground:start # start WordPress Playground at http://127.0.0.1:9400
npm run test:e2e # run Playwright testsSee RELEASE.md.