Skip to content

Automatically disable admin bar in AMP when theme has too much CSS #1800

@westonruter

Description

@westonruter

The admin bar accounts for about 20KB of CSS when it is displayed. This is 40% of the total 50KB CSS budget (😱). Very frequently themes have more than 30KB of CSS meaning that some CSS has to be excluded to remain valid AMP. Since the admin bar gets added early, its stylesheets end up being enqueued first and this can have the effect of causing the theme's own stylesheet to be excluded. This is very bad. Because the admin bar has so much CSS, there is an admin setting to disable it in AMP:

image

Since it is very common for the admin bar to incur too much CSS when it is added, the AMP plugin should automatically enable this setting to disable the admin bar when an excessive_css validation error happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions