Global Styles: Allow access in the post editor#72681
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. |
|
Size Change: +104 kB (+4.58%) 🔍 Total Size: 2.37 MB
ℹ️ View Unchanged
|
39c91a6 to
63e90ce
Compare
63e90ce to
f8db0ce
Compare
|
|
||
| // Expect a 2px border (added in JS). | ||
| await expect( defaultBlock ).toHaveCSS( 'border-width', '2px' ); | ||
| await expect( defaultBlock ).toHaveCSS( 'border-width', '3px' ); |
There was a problem hiding this comment.
Any specific reason for changing this?
There was a problem hiding this comment.
Yes, now that I added the "theme" styles to the plugin, it will be 2px even without the change made in JS. So in order to test the change properly (and ensure it's the JS one that is applied), I updated to 3px.
| @@ -0,0 +1,11 @@ | |||
| export default function WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) { | |||
There was a problem hiding this comment.
Not for here, but I guess we could reuse this for the other edit packages.
ntsekouras
left a comment
There was a problem hiding this comment.
It's a huge PR and tried to look into as much as I could, but not 100% I missed something. I couldn't pinpoint any issue and manually it tests well for me. Thanks!
|
I think this PR caused a regression in the Load Patterns metric for the Post Editor, but maybe that's to be expected since it adds more overhead to the post editor? The Load Patterns in the Site Editor looks like it's down because of this PR though. |
|
Looks like it improved the "navigate" metric in the site editor though haha :) (To be honest I don't understand exactly why) |
I noticed that too and even checked to make sure it wasn't within the normal variance haha. I'll give the PR a look through and see if I notice anything. |
|
Was it intended that this PR removed the Global Styles button from the site editor when editing a Page? If not, it appears this PR has caused a regression. The Global Styles button is still there when editing templates etc.
Steps to replicate:
|
It was intended unless you have "show template" true. |
Is there any reason to hide the Global Styles button when "Show template" is disabled? Previously, the Global Styles worked correctly even when "Show template" was disabled. |
Yes, but before it was only in the site editor, if we keep global styles in "show template disabled", it means global styles will always be visible even in the post editor which creates confusion for the users. |
I see, I personally prefer the Global Styles button to always be visible, but I understand your concern :) |
|
@t-hamano If you feel strongly, I think we can create an issue to discuss it, I personally don't have a strong preference. I recall this being a suggestion but can't recall from who :) |
|
Issue to discuss the behavior of the Global Styles button: #74944 |



Closes #72317
What?
This PR migrates global styles infrastructure and UI from the edit-site package to the editor package which makes Global Styles available in edit-post automatically. This also simplifies a lot of things in the editor package and allows us to remove some hacks and unstable props.
Why?
How?
Testing Instructions
Test in both the site editor and the editor in edit-post. The styles panel should appear in the post editor when editing the template of a post/page or when "show template" is toggled on.