Skip to content

Commit

Permalink
Output base styles on classic themes
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Sep 16, 2022
1 parent 68e7f56 commit ebbfcc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/compat/wordpress-6.1/block-editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ function gutenberg_get_block_editor_settings( $settings ) {
} else {
// If there is no `theme.json` file, ensure base layout styles are still available.
$block_classes = array(
'css' => 'base-layout-styles',
'__unstableType' => 'base-layout',
'css' => 'styles',
'__unstableType' => 'base-styles', // setting this to something other than `theme` means that the editor will not consider these styles as part of "theme" styles.
'isGlobalStyles' => true,
);
$actual_css = gutenberg_get_global_stylesheet( array( $block_classes['css'] ) );
Expand Down
4 changes: 1 addition & 3 deletions lib/compat/wordpress-6.1/get-global-styles-and-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ function gutenberg_get_global_stylesheet( $types = array() ) {
}
$tree = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data();
$supports_theme_json = WP_Theme_JSON_Resolver_Gutenberg::theme_has_support();
if ( empty( $types ) && ! $supports_theme_json ) {
$types = array( 'variables', 'presets', 'base-layout-styles' );
} elseif ( empty( $types ) ) {
if ( empty( $types ) ) {
$types = array( 'variables', 'styles', 'presets' );
}

Expand Down

0 comments on commit ebbfcc6

Please sign in to comment.