-
Notifications
You must be signed in to change notification settings - Fork 384
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
Comments
This setting should even be theme-specific. When switching to another theme, the available space for the admin bar should be re-checked. |
I wonder if we could additionally make some contributions to core to reduce admin bar CSS in general. This would benefit everyone. |
That would be excellent. 👍 |
New ticket opened here: https://core.trac.wordpress.org/ticket/46003 |
See #1921 for an alternative proposal. |
Closing in favor of #1921. |
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:
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.The text was updated successfully, but these errors were encountered: