Skip to content

Proposal: Just-In-Time Block CSS #2076

@eric-michel

Description

@eric-michel

Feature Description

For Block themes, WP modularizes and serves only the stylesheets needed for the blocks actually on the page, which is great! But it serves them all in the <head> tag, which is not as great, because all of them become render blocking even if their corresponding blocks are below-the-fold.

Would it be possible to modify the output of each CSS file to be enqueued just before the first instance of its relevant block? That way, the CSS for my social icons block in the footer doesn't have to be parsed before my hero cover block is rendered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DiscussionAnything that needs a discussion/agreement[Plugin] Optimization DetectiveIssues for the Optimization Detective plugin[Type] EnhancementA suggestion for improvement of an existing feature

    Type

    No type

    Projects

    Status

    Not Started/Backlog 📆

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions