By default, a WordPress theme's stylesheet only applies to the front end, so the block editor and the published post rarely look alike. Loading a dedicated editor stylesheet closes most of that gap. The bundled Twenty Twenty theme already demonstrates this: open its editor and you'll see light styling applied to the content area.

The setup involves two pieces of work: a small PHP addition in the theme's functions.php that registers an editor stylesheet, and the stylesheet itself. If you're customizing a theme you don't maintain, build a child theme first and make both changes there.
Registering the stylesheet
Open functions.php in the root of the theme folder and append the snippet below. It enables editor-styles support and points WordPress at the stylesheet file.
// Gutenberg custom stylesheet
add_theme_support('editor-styles');
add_editor_style( 'editor-style.css' ); // make sure path reflects where the file is located
That is all the PHP required. The add_theme_support function is documented in the WordPress developer reference if you want the full list of options.
Writing CSS that reaches editor blocks
Create editor-style.css in the theme root (or the child theme root) and fill it in. Standard element selectors are not enough: a plain h2 rule in this file will not change the text size of <h2> elements inside the post.
h2 {
font-size: 1.75em;
}
Editor styles have to target blocks rather than bare elements. To size a heading, scope the selector to the editable rich-text container:

h2.rich-text.block-editor-rich-text__editable {
font-size: 1.75em;
}
A file covering the common block editor elements with this scoping pattern is available on GitHub; replace its rules with values that match your own theme. The most practical approach is to start from your front-end stylesheet and copy rules across, adjusting element classes where they need to apply inside the editor window. If a rule seems not to take effect, inspect the element with the browser's DevTools to identify the classes in play.
Before and after
An unmodified editor renders content with default Gutenberg styling:

The front end of the same test site looks quite different — gradients, a custom font, styled buttons and blockquotes, and containers that aren't strictly square:

Once the custom stylesheet is loaded, the editor content area matches the front end: content width, fonts, colors and individual elements all line up, including the background treatment behind the post title.

The practical payoff is editing without a second browser tab open for previews. Two changes — the PHP registration and the editor stylesheet — are enough to get there.



