Make WordPress Core


Ignore:
Timestamp:
06/25/2021 03:31:21 PM (3 years ago)
Author:
youknowriad
Message:

Block Editor: Do not load a default font family for themes with theme.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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-editor.php

    r51237 r51240  
    471471    global $editor_styles;
    472472
    473     $styles = array(
    474         array(
    475             'css'            => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }',
    476             '__unstableType' => 'core',
    477         ),
    478     );
     473    if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
     474        $styles = array(
     475            array(
     476                'css'            => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }',
     477                '__unstableType' => 'core',
     478            ),
     479        );
     480    } else {
     481        $styles = array();
     482    }
     483
    479484    if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
    480485        foreach ( $editor_styles as $style ) {
Note: See TracChangeset for help on using the changeset viewer.