-
Notifications
You must be signed in to change notification settings - Fork 382
Description
Currently when there is too much CSS, the first stylesheet that exceeds the 50KB limit is excluded from being included on the page. This leads to pages that appear broken. While prioritizing the stylesheets to concatenate will help a lot (#2322), we should also consider whether we should exclude stylesheets by default. This is particularly important when activating AMP on a theme that has more than 50KB of CSS even without the admin bar, or when a certain combination of blocks causes more than 50KB of CSS to be added to the page after tree shaking.
We currently have this toggle to automatically-accept validation errors, which results in excessive CSS being excluded:
What if an excessive_css validation error was a special case which instead defaulted to “New Rejected” status? On a Native mode site, this would result in the amp attribute being removed from the html element, and essentially serving an unmarked AMP page which would be able to take advantage of all the performance benefits of AMP except for being served from the AMP cache.
Should this auto-reject for excessive_css apply to Transitional mode as well or just Native mode? I'm thinking no, as the non-AMP version would be a better default that includes all the CSS. The primary problem today is Native mode sites that exclude CSS.
If we do this, it will be important to show a notice that too much CSS is on the page: #1801.
