Blocks CSS: CSS Editor for Gutenberg Blocks

Àpèjúwe

Blocks CSS allows you add custom CSS to your Blocks straight from the Block Editor (Gutenberg).

It adds a syntax-highlighted CSS Editor where you can add additional CSS to your Gutenberg Blocks to style them the way you want.

All the code and sources for this plugin are publicly available as part of https://github.com/Codeinwp/otter-blocks.

Àwọn àwòrán ìbòjú

  • CSS Editor
  • CSS Editor

Àwọn ìdí

Plugin yìí pèsè 5 àwọn ìdí.

  • Text A rich text element with tag selection.
  • Icon An inline SVG icon from the Lucide icon set.
  • Link An anchor element with link picker and rich text.
  • Box A generic wrapper element with tag selection and inner blocks. Supports details and summary tags for native disclosure widgets.
  • Image A simple image element. Set via media library or direct URL.

Àwọn àgbéyẹ̀wò

Èrèlé 8, 2026 1 ìdáhùn
Works like a charm on any of my recent WP projects. [EDIT]I need to change my review.On some setups, I get two CSS editors shown in the “Custom CSS” attribute panel, and only contents of the second instance are getting saved.Problem:Two CodeMirror editors are displayed in the Custom CSS panel of the Blocks CSS plugin instead of one. Both editors are located in the same container. Assumed Root Cause:WordPress enables React StrictMode by default in the Block Editor. React StrictMode runs useEffect hooks twice to detect potential side effects. Analysis:The Blocks CSS plugin initializes CodeMirror in a useEffect hook.Since this useEffect doesnÌtumọ̀ Yorùbá: ’t have a cleanup function that checks whether CodeMirror is already initialized, wp.CodeMirror() is called again on every mount cycle. With StrictMode enabled, this means: twice on the same DOM element. Probable Solution:The useEffect hook should implement a cleanup function that prevents CodeMirror from being initialized multiple times on the same element.Side Notes:This only happens in some of my setups. I couldnÌtumọ̀ Yorùbá: ’t figure out any possibly conflicting theme, plugin or code snippet. So I assume it might be something like a timing issue. Conclusion:I wonÌtumọ̀ Yorùbá: ’t change the 5-star rating, because despite of this problem the plugin does its job. And I know how to handle this issue by a simple CSS rule to hide all Block CSS CodeMirrors except the last one:#o-css-editor .CodeMirror:not(:last-child) { display: none;}
Agẹmọ 24, 2024 1 ìdáhùn
“Essential, Useful Tool, Completes the Block Editor, Should be part of the core,” The one thing they donÌtumọ̀ Yorùbá: ’t mention is how quick and genuinely concerned the support is.
Ọwẹ́wẹ̀ 26, 2023 1 ìdáhùn
CanÌtumọ̀ Yorùbá: ’t think of Block Editor without this. Tiny powerful thing. Only thing I hate in this plugin is the following line: $render_css = empty( $file_name ) || strpos( $file_name, ‘post-v2’ ) === false; This means if you deactivate Otter, your content might just break 🙁
Ka gbogbo àwọn àgbéyẹ̀wò 25

Àwọn Olùkópa & Olùgbéejáde

“Blocks CSS: CSS Editor for Gutenberg Blocks” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa sí plugin yìí.

Àwọn Olùkópa

A ti túmọ̀ “Blocks CSS: CSS Editor for Gutenberg Blocks” sí àwọn èdè agbègbè 8. Ọpẹ́lọpẹ́ fún àwọn atúmọ̀ èdè fún àwọn ìkópa wọn.

Túmọ̀ “Blocks CSS: CSS Editor for Gutenberg Blocks” sí èdè rẹ.

Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

Ṣàwárí koodu, ṣàyẹ̀wò ibi ìpamọ́ SVN, tàbí ṣe àgbékalẹ̀ sí àkọsílẹ̀ ìdàgbàsókè nípasẹ̀ RSS.

Àkọsílẹ̀ àwọn àyípadà

You can check the changelog here.