-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Site editor: remove "default" admin CSS #66431
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What about the "colors" stylesheet itself, don't we need it? Isn't it what allows us to handle user color schemes properly. |
@youknowriad I don't believe so. It's a generated stylesheet that targets old admin stuff. We set our own CSS variables and use those variables in our stylesheets. I tested the "modern" admin theme, and the colours still work in the site editor with this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoke test this. I can spot any style issue.
It looks like the admin CSS has been removed, causing the mobile layout to not display correctly: We'll probably need to add some Furthermore, we'll also need to take into account the case when JavaScript is disabled in the browser. Here's what it currently looks like: With this in mind, we may need the admin-menu style anyway. |
Just came here to comment on this 😅 I wonder if we could prevent the markup from loading altogether in these screens. For the wider breakpoints the content is just overlaying the admin menu anyway. |
I've put up a revert PR over in #66540 for now. |
What?
We are loading a TON of css in the site editor that never use. The culprit seems to be the
colors
handle, which in turn enqueueswp-admin
.wp-admin
in turn enqueues basically all css of every admin screen there is:I don't know why this was ever done, but that ship has sailed for the normal admin. For the site editor however, we should be a lot more picky and explicitly add the dependencies we need to our own stylesheet. That's already the case: as you will see, even after dequeuing
colors
, the handles that we need such asdashicons
,common
,forms
etc. are still loading.Why?
One of the thousand needles that degrades site editing loading performance. Note that each extra stylesheet is a blocking request.
How?
Dequeue
colors
. This is added to all admin pages here:https://github.com/WordPress/wordpress-develop/blob/de38e8eeecf80a7ca5ee870ec68a59897216b33b/src/wp-admin/admin-header.php#L93
Testing Instructions
Load the site editor and check that the
list-tables
CSS file is gone for example.Testing Instructions for Keyboard
Screenshots or screencast