[wp-trac] [WordPress Trac] #58519: Inline styles block styles in bundled themes
WordPress Trac
noreply at wordpress.org
Mon Jun 12 14:11:07 UTC 2023
#58519: Inline styles block styles in bundled themes
---------------------------+-----------------------------
Reporter: spacedmonkey | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version: 5.8
Severity: normal | Keywords:
Focuses: performance |
---------------------------+-----------------------------
In [50836] function was added, to inline block styles, so for better
performance. There are a number of small stylesheets in bundled themes
that could do with that could use this functionality. To opt-in a
stylesheet, simply add the path add an extra piece of data of the
stylesheet. Like this.
{{{#!php
wp_enqueue_style( 'twentyfifteen-block-style',
get_template_directory_uri() . '/css/blocks.css', array( 'twentyfifteen-
style' ), '20230122' );
wp_style_add_data( 'twentyfifteen-block-style', 'path',
get_template_directory() . '/css/blocks.css' );
}}}
This could improve FE performance, as it remove a blocking request.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58519>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list