How to add css to just editor view

[ad_1]

I’m building a site (no link yet, still on my desktop) based on TTT and I have a number of CSS animations that fade in from opacity 0 when they enter the viewport (triggered by js observer). but this doesn’t happen when in editor view (Appearance > Editor > Pages nor Appearance > Editor > Pages > [specific page or template or part]

in the old theme method, you could shimmy an editor.css stylesheet into the backend view like so

function themename_execute_on_edit_new_views($hook) {
// Check if we are on a post add or edit screen
if (‘post.php’ === $hook || ‘post-new.php’ === $hook) {
wp_enqueue_style(‘themename-admin-styles’, get_theme_file_uri(‘editor.css’), false, ‘1.0’, ‘all’);
}
}

add_action(‘admin_enqueue_scripts’, ‘themename_execute_on_edit_new_views’);

Is there some way to inject custom css to just the Editor views? I don’t want to bloat up my front end CSS with editor only styles.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer