Are gutenberg blocks ideally supposed to look the same in both back-end and front-end?

admin2025-06-05  2

This appears to be the case with built in blocks at the moment. If you use them with default Twenty Nineteen theme you get the same look in both backend and frontend

When building custom theme, should we make sure blocks are identical in both cases? It seems that this requires loading the same CSS frameworks and JS in back-end and front-end

This appears to be the case with built in blocks at the moment. If you use them with default Twenty Nineteen theme you get the same look in both backend and frontend

When building custom theme, should we make sure blocks are identical in both cases? It seems that this requires loading the same CSS frameworks and JS in back-end and front-end

Share Improve this question asked Dec 20, 2018 at 18:18 user1089548user1089548 1211 silver badge3 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Ideally, yes. Blocks are supposed to be WYSIWYG. See the Editor Styles section of the Gutenberg Handbook for how to load theme styles in the editor.

You need to add an editor stylesheet with add_editor_style(), the same way you did with the previous editor, but to support the block editor you need to declare theme support for editor styles:

add_theme_support( 'editor-styles' );
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749079902a316186.html

最新回复(0)