-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Styles Tab: Fix bug where contentOnly experiment forced it to always be displayed #73534
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
Styles Tab: Fix bug where contentOnly experiment forced it to always be displayed #73534
Conversation
…the contentOnly experiment active
|
Size Change: -8 B (0%) Total Size: 2.54 MB
ℹ️ View Unchanged
|
talldan
left a comment
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.
Makes sense, thanks!
|
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. |
|
LGTM - good spotting! |
|
Thanks for the quick reviews! |
What?
Follow up to:
This PR fixes a bug where the Styles tab was showing in the block inspector when it shouldn't. I noticed this while testing out the HTML block while I had the contentOnly experiment running.
Why?
In #71982 the styles tab (and color controls) were enabled to be exposed in content only mode while editing content for patterns. It looks like there's an unnecessary check for the experiment in the styles tab that was forcing it to always be displayed. This isn't needed, because the check is already looking for
hasStyleFills, and the controls are already adding a fill viaSectionBlockColorControlswhich usesColorEdit, which usesColorInspectorControlwhich usesInspectorControlswith the color group here.So, we should be able to remove the experiment from the check, as the component will naturally show the color controls when needed, and this will allow us to hide the styles panel again when it shouldn't be shown (as is the case for the HTML block).
How?
DELETE the contentOnly experiment from the check in the styles tab.
Testing Instructions
<p>A paragraph</p>and update itScreenshots or screencast
Before
After
ContentOnly color controls should still be available