[wp-trac] [WordPress Trac] #58454: script-loader.php doesn't support font-display: optional, that is recommended for performance

WordPress Trac noreply at wordpress.org
Sun Jun 4 13:47:04 UTC 2023


#58454: script-loader.php doesn't support font-display: optional, that is
recommended for performance
--------------------------+-----------------------------
 Reporter:  asafm7        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:  performance   |
--------------------------+-----------------------------
 script-loader.php doesn't support font-display: optional, which is
 recommended by Google to reduce CLS.

 Current code:

 {{{
         // Check the font-display.
         if (!in_array($webfont['font-display'], array('auto', 'block',
 'fallback', 'swap'), true)) {
             $webfont['font-display'] = 'fallback';
         }
 }}}

 font-display: optional combined with https://web.dev/preload-optional-
 fonts/ is recommended by Google to reduce CLS:

 https://web.dev/preload-optional-fonts/

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58454>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list