Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
westonruter opened this issue Jan 8, 2019 · 6 comments
Closed
Labels

Comments

@westonruter
Copy link
Member

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.

@westonruter
Copy link
Member Author

This setting should even be theme-specific. When switching to another theme, the available space for the admin bar should be re-checked.

@swissspidy
Copy link
Collaborator

I wonder if we could additionally make some contributions to core to reduce admin bar CSS in general. This would benefit everyone.

@westonruter
Copy link
Member Author

That would be excellent. 👍

@swissspidy
Copy link
Collaborator

New ticket opened here: https://core.trac.wordpress.org/ticket/46003

@westonruter
Copy link
Member Author

See #1921 for an alternative proposal.

@westonruter westonruter removed this from the v1.1 milestone Mar 14, 2019
@westonruter
Copy link
Member Author

Closing in favor of #1921.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants