-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Global styles: add background to global styles changes output #60229
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: +397 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
…es. Updates tests.
de9d5a7
to
b821de7
Compare
packages/block-editor/src/components/global-styles/get-global-styles-changes.js
Outdated
Show resolved
Hide resolved
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.
…styles-changes.js Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com>
Thanks for the quick test 🙇🏻
You passed the test! Thank you! |
…ess#60229) * Adding "background" top-level styles to the possible change list values. Updates tests. Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
I'm curious, why doesn't this follow the same UI/UX as the Group block's background controls? I.e. when there's an image, you see the related controls, "cover" is set as the scale initially, and "repeat" is available (on) when contained or fixed size. The focal point picker should also be fullwidth, like it is on the group block's controls. We should follow-up with these; it feels a bit under-baked experience wise. |
Thanks for checking out this feature!
As far as I can see the focal point picker is fullwidth in both cases, but only when an image is selected. When there is no image, the picker is narrower in both instances.
The picker's width could be forced to 100% in all scenarios however. Is that what you mean?
As for the background size controls showing by default in the global styles, I think the original thought was to make it apparent to the user that the image can be tweaked, but I also think they could be unified. The background image control might look lonely, but I'm not sure it's useful to show the controls before an image is added anyway. There's also some further discussion about design going on over in #60264 (comment)
In the first iteration, the site and block background sizes were the same, that is, "cover". The switch to remove the background size value for the site background was deliberate. The rationale was to make it more likely for the user to see their image choice in the background of the target element as soon as it is selected. So, taking the same image, here's how it looks side by side:
The above was based on testing several dozen images of various dimensions, but I understand every scenario is different, so there's no one size fits all. I'm open to standardizing the controls across global and block styles - it'd be good to do it soon. I have what probably is an unpopular stance - that we shouldn't add any opinionated defaults, but happy to implement what folks thinks works best for users. Thank you! |
…ess#60229) * Adding "background" top-level styles to the possible change list values. Updates tests. Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
What? How??
Follow up to:
Part of:
Adds "background" top-level styles to the possible change list values. Updates tests.
Why?
So that changes to background styles will be reported in the save entity panel and also the global styles revision items.
Testing Instructions
In the site editor, open the Global styles panel.
Select "Background".
Add a background image
Save the template.
Check that "Background styles" appears in the list of changes to be saved.
Now open up the revisions panel, and select the latest revision.
Check that "Background styles" appears in the list of revision changes.
Run the unit tests:
npm run test:unit packages/block-editor/src/components/global-styles/test/get-global-styles-changes.js