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
- Style priority in theme.json
- How to add a class to a core block in both admin editor and frontend?
- How to force Gutenberg to follow all custom CSS styling in preview?
- Disable WP-Elements Class Creation (Gutenberg)
- Block editor: can’t change format of inline code blocks
- grid overlapping problem
- CSS Selector to override default theme.json custom properties in theme stylesheet
- Child theme CSS not applying to element
- How to Style Primary Menu with Active Class
- Set 3 iframes in a row
- Google yolo one tab signup plugin avilable in wordpress? [closed]
- Make CSS Changes To Only Affect Mobile Browser [closed]
- Disable File Editing function
- Get post format and use it as a CSS class in different spans
- wp_enqueue_scripts and CSS
- User gets access denied to css files and js files even though user is logged in [closed]
- Getting values from options page to css
- Hiding Label via CSS
- Conditionally enqueue a stylesheet based off of a javascript click event
- WordPress 6 – inline container styles breaking my site
- How to make a difference between the portfolio list, and a portfolio item?
- Custom CSS is not working?
- how to stop the shaking effect on my homepage [closed]
- List item images perfect on Chrome/Edge, css fudged on FF/IE [closed]
- Cannot change hover color for links [closed]
- prevent HTML output if custom field is empty [closed]
- How to make jquery slider to start afresh [closed]
- Custom CSS based on the Author of a Post
- How to properly hide the div of an inline collapsible button?
- How can we create our own formatting style?
- I can not change the background-color value of wp: meta_value of content.xml
- Is it better to add to style.css or create your own css when using a template?
- My custom theme text and content format
- Hide Login Page Labels
- CSS Changes made, lost mobile functionality
- Content alignment in Twenty Fourteen Theme
- Color Picker – Theme options
- Extending site width according to the image size
- How to edit wordpress native gallery’s css file?
- Animate.CSS with a child theme
- Change Twenty twelve theme background color
- How to change header from full-width to box width
- remove author and date from all posts [closed]
- Add woocommerce plugin in own theme
- Change sidebar product category text color (woocommerce) [closed]
- IOS Ventura Safari 16.3 position fixed elements goes above scroll bar
- Elementor Contact Form Submit button has empty class
- How can I make one button a different color from the other buttons on my site?
- How can I highlight the active page using paginate_links()?
- How do I change the CSS for all Page Title sections across an Elementor website?
- How do I remove/hide embed excerpts from posts
- when I am logged in my page seems to be proper, but when I am just visiting the page in incognito, some css are not applied & page looks weired
- WordPress login/register custom CSS not working?