-
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: send theme object to setUserConfig #61805
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: -90 B (-0.01%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
Flaky tests detected in fc5da99. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9475993466
|
Thanks mate. Missed one here—this could be simply gutenberg/packages/edit-site/src/components/global-styles/screen-revisions/index.js Lines 94 to 103 in 57b8b61
Yes 😀 this would be a nice cleanup. I think do it as part of these changes in this PR. |
Thanks for testing this one. Will do 👍🏻 |
18e2d5c
to
97d34b2
Compare
…lobal styles. Use the object arg for variations, pushing to global styles from block settings, and reset global styles.
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.
Thanks! Much simpler, and this tests well for me.
Let's not backport to 6.6 as it's only code quality.
Thanks for helping with this one. 🙇🏻 |
* Instead of destructuring object, just send it. The global styles provider does the work. * Remove unnecessary callback - use state function to set current revision * Allow an object or a function in the setConfig function, which sets global styles. Use the object arg for variations, pushing to global styles from block settings, and reset global styles. Co-authored-by: ramonjd <[email protected]> Co-authored-by: noisysocks <[email protected]>
Adding this code quality PR to be backported to resolve a conflict. |
* Instead of destructuring object, just send it. The global styles provider does the work. * Remove unnecessary callback - use state function to set current revision * Allow an object or a function in the setConfig function, which sets global styles. Use the object arg for variations, pushing to global styles from block settings, and reset global styles. Co-authored-by: ramonjd <[email protected]> Co-authored-by: noisysocks <[email protected]>
I just cherry-picked this PR to the wp/6.6-beta-3 branch to get it included in the next release: 55abcaa |
* Instead of destructuring object, just send it. The global styles provider does the work. * Remove unnecessary callback - use state function to set current revision * Allow an object or a function in the setConfig function, which sets global styles. Use the object arg for variations, pushing to global styles from block settings, and reset global styles. Co-authored-by: ramonjd <[email protected]> Co-authored-by: noisysocks <[email protected]>
What?
Follow up to #61271
Instead of destructuring object, just send it to the global styles provider callback via
setUserConfig
.Props to @noisysocks for catching it, and for giving me pause to discover how trivial the change is.
ShouldsetUserConfig
accept a function and an object?Also,
setUserConfig
now accept a function and an object to update user global styles. So,Why?
The global styles provider does the work of splitting the properties into
styles
,settings
and_links
.Testing Instructions
There should be no regressions in the way global style variations or revisions work.
I'm using Twenty Twenty Four to test.
There should be no JS errors, and the theme styles should apply to the canvas.
2024-05-20.11.12.49.mp4
To test the
setUserConfig
arguments:There should be no regressions.