WordPress / WordPress/performance
Proposal: Just-In-Time Block CSS
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 461
- Forks
- 165
- Avg merge
- 11h 12m
- Merged PRs (30d)
- 28
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Begin by locating how Block themes enqueue and output block stylesheets, then determine whether styles can be emitted before the first relevant block; done means a defined implementation approach with tests covering above- and below-the-fold blocks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, php, wordpress
- Domain
- frontend, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100