-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Site Editor: Always show Additional CSS button #71537
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
Conversation
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.
This makes sense to me and makes the feature more predictable.
IIRC, the condition was introduced to highlight other ways for style modification.
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. |
Size Change: -8 B (0%) Total Size: 1.93 MB
ℹ️ View Unchanged
|
Flaky tests detected in 07f43fd. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17538302780
|
@Mamaduka thanks for the review! |
Thank you @t-hamano Aki. I happen to look for it a few days ago and could not find the Additional CSS area. I am glad to hear that it now will be visible at all times in the Styles panel. |
@t-hamano if this going to be more prominent all the time, it'd be important to clarify further for users the tradeoffs and mechanics in copy. Part of the reason to keep this less prominent by default was that custom CSS applied on a block type basis would have the advantage of going through the style engine and be output only when those blocks are present on the page, while code added to the general custom css panel will always be loaded. If users use it for convenience or think that's the only / main way to add CSS, it will lead to unwanted performance issues. |
Yeah, I think the "Add your own CSS to customize the appearance and layout of your site." language is too imperative/demanding. A way to improve it would be to include a link to global styles, and changing the wording to be more passive and make it clear that this is more of a "last resort" solution. |
Thank you everyone for your feedback! I'd like to address your suggestions in a follow-up. |
This ends the endless confusion for users, who thought it might not be available at all. So Thank You @t-hamano for making it possible. It's also consistent with the Styles sidebar on the right where Additional CSS is still available. The need for additiional CSS is getting smaller and smaller now, but I am glad we are not leaveing users stranded like that. |
Follow-up PR: #71550 Any feedback is welcome! |
Co-authored-by: t-hamano <[email protected]> Co-authored-by: Mamaduka <[email protected]>
Extract only a part from #66476
What?
This PR makes the Additional CSS button always visible in the Styles panel.
Why?
When there is no custom CSS defined, the Additional panel isn't displayed. This is the expected behaviour implemented in #47371
However, I realized that many users considered this behavior to be a bug.
Ideally, we'd move forward with restructuring the Styles panel in #66476, but for now, I believe at least the Additional CSS panel should always be visible.
Another issue is that even though you are accessing the same URL (http://localhost:8888/wp-admin/site-editor.php?p=%2Fstyles§ion=%2Fcss), the screen you see will be different depending on whether you have additional CSS (See #71335 (comment) for more details).
Testing Instructions
Confirm that the Additional CSS button is always displayed in the Styles panel.
Screenshots or screencast