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鈥檒l 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

Comments

Projects
None yet
2 participants
@westonruter
Copy link
Member

commented Jan 8, 2019

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

This comment has been minimized.

Copy link
Member Author

commented Jan 14, 2019

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

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Jan 15, 2019

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

@westonruter

This comment has been minimized.

Copy link
Member Author

commented Jan 15, 2019

That would be excellent. 馃憤

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Jan 16, 2019

@westonruter

This comment has been minimized.

Copy link
Member Author

commented Mar 2, 2019

See #1921 for an alternative proposal.

@westonruter westonruter removed this from the v1.1 milestone Mar 14, 2019

@westonruter

This comment has been minimized.

Copy link
Member Author

commented Mar 14, 2019

Closing in favor of #1921.

@swissspidy swissspidy added the CSS label Jun 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.