Skip to content

Commit

Permalink
Block Editor: Do not load a default font family for themes with theme…
Browse files Browse the repository at this point in the history
….json.

This matches the behavior that has been in place in the gutenberg plugin.
The idea is that this makes the editor match the frontend by default for these themes.
If they use a custom font, they'll have to provide it for the editor as editor styles.

Props nosolosw.

Built from https://develop.svn.wordpress.org/trunk@51240


git-svn-id: http://core.svn.wordpress.org/trunk@50849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
youknowriad committed Jun 25, 2021
1 parent 49a6a14 commit 578cda5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions wp-includes/block-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,17 @@ function block_editor_rest_api_preload( array $preload_paths, $block_editor_cont
function get_block_editor_theme_styles() {
global $editor_styles;

$styles = array(
array(
'css' => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }',
'__unstableType' => 'core',
),
);
if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
$styles = array(
array(
'css' => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }',
'__unstableType' => 'core',
),
);
} else {
$styles = array();
}

if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
foreach ( $editor_styles as $style ) {
if ( preg_match( '~^(https?:)?//~', $style ) ) {
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-beta3-51239';
$wp_version = '5.8-beta3-51240';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 578cda5

Please sign in to comment.