In the meanwhile I posted this question also on Stackoverflow. I got a hint in a comment to the question which led me to a solution. I didn’t find a pure CSS solution, but used the following jQuery script to add according classes dynamically:
$(document).ready(function() {
if($('body').hasClass('post-type-page')) {
$('#editor').addClass('post-type-page');
} else if($('body').hasClass('post-type-post')) {
$('#editor').addClass('post-type-post');
}
});
Essential was to enqueue that using admin_enqueue_scripts
, separately from the frontend scripts. For more details, see https://stackoverflow.com/a/60155398/5641669
Related Posts:
- Are there Gutenberg container blocks?
- show classes as dropdown in guttenberg`s additional css classes input box
- Style new block-editor alignfull class without scrollbars or overflow
- What CSS rules are introduced to core blocks through wp-block-styles?
- Gutenberg Block Editor Match Admin Styles & Frontend Styles
- If I dequeue Gutenberg Stylesheet will that have any effect on WordPress 5.0.1?
- Remove WordPress/Gutenberg button styles for ACF blocks
- Gutenberg Additional CSS Class without modifying theme?
- How to override Gutenberg admin CSS
- Different css rules for TinyMCE and Gutenberg while using add_editor_style()
- Can you edit WP gutenberg block css without a plugin?
- How to stop Gutenberg from outputting inline CSS for specific blocks?
- Enqueue styles in new site editor in WordPress 5.9
- create bootstrap columns inside editor group block
- Add Custom Alignment Option to WordPress Blocks/Gutenberg
- Simple way to add custom class and ids to individual Gutenberg blocks
- The Global Styles missing
- ACF Gut block broke wordpress default style?
- Scroll code block instead of wrapping text
- Default paragraph block styles just for pages NOT for posts?
- Custom CSS in Widget editor (Gutenberg) gets stripped out
- Custom Gutenberg color classes naming convention
- Adding a new block editor color option to a theme
- Stop custom Gutenberg styles taking over other admin bits?
- Why can’t blocks be hidden with jQuery?
- Gutenberg CSS Issue
- Trying to make an image a circle in Gutenberg
- What is the cleanest way to shrink Gutenberg Blocks to container width?
- Gutenberg Editor: display error with a combination of transform and background-attachment:fixed
- Default Gutenberg CSS on frontend
- Customizing the CSS for the post/page editor?
- Use of CSS classes in editor-blocks.css file
- Images at the same vertical position in multiple columns
- How do I make my block-editor styles match my front-end styles?
- Dequeue classic-themes.min.css
- How can I add a section with a different background color?
- Narrow paragraph block aligned to left of “wrapper”
- adding additional css classes have no effect within block editor
- How do I change search input padding for blockbase child theme?
- Insert a group block inside a list item
- Full Site Editing Non-editble global styles?
- Block content rendered with inline CSS. How do I reuse it in a headless setup?
- How to add arbitrary custom CSS to a WordPress Block Theme using Site Editor?
- How to remove class=”wp-block-heading” from Heading tags?
- Gutenberg: where to find style settings
- Custom block style not working in the editor
- Customize margin between paragraphs using the Gutenberg Style editor
- How can I vertically center a “div” element for all browsers using CSS?
- How do I hide the bullets on my list for the sidebar?
- How to center HTML5 Videos?
- difference between css height : 100% vs height : auto
- Using margin / padding to space span tag from the rest of the p tag
- Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?
- Style something only on the home page
- How do I register/enqueue a custom CSS file?
- Why isn’t my theme processing SASS?
- PageLines theme: how to change the background color of the main content vs. entire page?
- Changing CSS in Twenty Eleven to change font size of body text
- Deregister CSS style link ‘open-sans-css’
- @wordpress/create-block image url in css
- Styling Custom Meta Boxes?
- Customizing wordpress to match your site theme
- Is it better to put CSS in additional CSS or in Child theme styles.css [closed]
- Adding HTML to the Header, Screws up in IE7
- How to float an image in Gutenberg
- Getting page output HTML without request (for CriticalCSS, PurgeCSS)
- How to organize priority of plugins CSS files?
- Responsive Images Warping
- Remove margin from CSS gradient color code
- Seperate functions.php for part of site
- Internet Explorer ignore my css
- How can I remove the ::after CSS selector which is automaticaly appended to the_content()?
- Hover colour spreading out beyond submit button
- post_class not working with css
- Adding CSS to Blog Posts?
- Where do I go to change the position of the style.css?
- Using PHP Increment and Conditional Statement to Alternate Loop Background
- Remove a Style Tag from WP Theme
- How to change the standard navigation menu color when using genesis [closed]
- CSS isn’t rendered on a post but just posted as text [closed]
- How to use css only H2 Tag? Site is considering website title also H2 tag and changing its style as well
- WordPress footer always at the bottom of the screen-page
- Dequeing Parent Fontawesome Deques Parent Styles
- CSS: Appearance/Customise display different to actual display
- Border around menu button [closed]
- Correct use of !important
- How to change hover link colour for blog post (body) text only
- Problems styling a Custom Link in a Menu
- Font .woff files loaded don’t correspond to the displayed styles [closed]
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- Twenty Fourteen: Shrinking header while scrolling down
- CSS ?ver=4.7.3 not found
- Custom CSS rules only apply to home page
- How to enqueue google fonts if we use directly in style.css
- How to change menu hover color to white on my theme? [closed]
- How can a left and right margin be added to the admin bar without access to “…wp-includes/admin-bar.php”?
- Inserting a DIV Block Into a Listing of Excerpts?
- WordPress Custom Superfish CSS Problem [closed]
- How enqueue CSS out of theme folder?
- Styling not refreshing for old visitors on WordPress