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/twentytwelve/functions.php

    r45256 r45485  
    166166
    167167        $query_args = array(
    168             'family' => 'Open+Sans:400italic,700italic,400,700',
    169             'subset' => $subsets,
     168            'family'  => urlencode( 'Open+Sans:400italic,700italic,400,700' ),
     169            'subset'  => urlencode( $subsets ),
     170            'display' => urlencode( 'fallback' ),
    170171        );
    171172        $font_url   = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
Note: See TracChangeset for help on using the changeset viewer.