WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/31/2019 10:09:39 AM (4 months ago)
Author:
flixos90
Message:

Bundled Theme: Load Google fonts with display=fallback parameter for better UX in case the font cannot be loaded.

Providing this query parameter ensures the stylesheet contains the font-display: fallback rule. This changeset also updates the Open Sans font used by core accordingly.

Props westonruter.
Fixes #47282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentythirteen/functions.php

    r45256 r45485  
    244244
    245245        $query_args = array(
    246             'family' => urlencode( implode( '|', $font_families ) ),
    247             'subset' => urlencode( 'latin,latin-ext' ),
     246            'family'  => urlencode( implode( '|', $font_families ) ),
     247            'subset'  => urlencode( 'latin,latin-ext' ),
     248            'display' => urlencode( 'fallback' ),
    248249        );
    249250        $fonts_url  = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
Note: See TracChangeset for help on using the changeset viewer.