Site logo

Archived topic

Adding css to child template, change admin side?

3 replies · Started by nomadiceman on August 10, 2021

Viewing posts 1–4 of 4

I’ve noticed that the css I add in the customiser doesn’t show the changes in the admin editing post side

If I created a child there and add css to that directly. Would the css changes show up in the admin side?

For example spacing of certain blocks. Or padding, margins etc in headings

Hi there,

If I created a child there and add css to that directly. Would the css changes show up in the admin side?

Yes this can work but you'll have to enqueue the stylesheet as an editor block style a well.

Example:

add_action( 'enqueue_block_editor_assets', function () {
wp_enqueue_style( 'custom-css', get_theme_file_uri( '/style.css' ), false );
} );

This assumes you're using style.css file on a child theme's main folder.

ah ok. I understand. Ill give it a shot

Let us know how it goes. :D

This archived topic is closed to new replies.