Support inlining critical CSS for faster core web vitals

Created on 15 January 2025, about 1 month ago

Problem/Motivation

On many of our clients projects we inline critical CSS in order to optimise core web vitals (CWV) such as largest contentful paint (LCP).
We do this by supporting a critical: true attribute in our theme's libraries.yml file and override the CSS collection renderer service to instead inline the CSS rather than attach it as a link tag.

This is consistent with guidelines on improving LCP

I think there is merit in exploring this as a core feature.

Steps to reproduce

Proposed resolution

Explore the benefits to this approach. There is a downside in terms of caching as this CSS isn't stored/served by CDNs like an external stylesheet. In our client projects it has made a difference

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component

asset library system

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024