Make WordPress Core


Ignore:
Timestamp:
05/31/2019 10:09:39 AM (5 years 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/twentyfourteen/functions.php

    r45218 r45485  
    295295    if ( 'off' !== _x( 'on', 'Lato font: on or off', 'twentyfourteen' ) ) {
    296296        $query_args = array(
    297             'family' => urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ),
    298             'subset' => urlencode( 'latin,latin-ext' ),
     297            'family'  => urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ),
     298            'subset'  => urlencode( 'latin,latin-ext' ),
     299            'display' => urlencode( 'fallback' ),
    299300        );
    300301        $font_url   = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
Note: See TracChangeset for help on using the changeset viewer.