BlockGlow — Per-block Custom CSS

BlockGlow — Per-block Custom CSS

Details
View on WordPress

BlockGlow adds a “BlockGlow — Custom CSS” panel to the inspector of every block. Use it to scope custom CSS to a single block instance. The plugin stores CSS in the uploads folder (under uploads/blockglow/) and enqueues the generated CSS file when rendering on the front end. If the uploads directory isn’t writable or file write fails, BlockGlow will fall back to outputting inline styles.

Key features:

  • Adds two block attributes to every block: blockglowCustomCSS and blockglowId.
  • Inspector panel with a CodeMirror-backed code editor (if WordPress provides it) or a fallback textarea supporting Tab and Shift+Tab outdent.
  • Live preview inside the block editor: custom CSS is scoped to the block in the editor so you can see the effect while editing.
  • CSS files are saved to wp-content/uploads/blockglow/blockglow-<id>.css and enqueued on the front end as a linked stylesheet; files are removed automatically when you clear the Custom CSS field.
  • Graceful fallback to inline styles when file writing isn’t possible.

How scoping works:

BlockGlow creates a unique blockglowId for each block instance and scopes your CSS with a wrapper selector like:

[data-blockglow-id="bg-xxxxxxx"] { /* your declarations */ }

For convenience you can use & as the wrapper shorthand in the editor. Example:

& .my-class { color: red; }

The plugin will replace & with the wrapper selector for both editor preview and front-end output.

Support

If you find issues or want improvements (for example: limiting who can edit per-block CSS, collecting styles into a single head include, or adding an admin UI to manage generated CSS files), open an issue in the repository or reply here and I will assist.

Details

Plugin code:
blockglow
Plugin version:
1.1.7
Outdated:
No
WP version:
5.8 or higher
PHP version:
8.2 or higher
Test up to WP version:
6.9
Total installations:
0
Last updated:
2026-01-11
Rating:
Times rated:
0
blocks
css
custom-css
editor
gutenberg