-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Global Styles: Add UI package #72599
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
|
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: +1.42 kB (+0.06%) Total Size: 2.19 MB
ℹ️ View Unchanged
|
f6c988d to
ba83d81
Compare
|
I only got time to test the following today (in the site editor and in the style section of site admin) ✅ Test main navigation 👍🏻 |
|
Hmm that failing E2E test passing for my locally. I'll re-run and see |
|
Flaky tests detected in 9a298a1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18743612455
|
|
Merging, this to continue the work, but I'll address whatever issues are raised, please ping me. |
Co-authored-by: youknowriad <[email protected]> Co-authored-by: ramonjd <[email protected]>
| [ name ] | ||
| ); | ||
| const [ variations ] = useGlobalStyle( 'variations', name ); | ||
| const [ variations ] = useSetting( 'variations', name ); |
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.
Looks like this one fell through our net
useGlobalStyle => useStyle not useSetting
Fix here:
This is the second part of this issue #72317 with the final goal of bringing global styles to the post editor.
What?
This PR extracts the Global Styles UI components from
@wordpress/edit-siteinto a new standalone package@wordpress/global-styles-ui.Why?
The Global Styles UI components were deeply embedded within the edit-site package, making them difficult to reuse in other contexts (like the post editor). By creating a dedicated package:
How?
Package Structure
@wordpress/global-styles-uipackage with its ownpackage.jsonand dependencies.tsx,.ts)Integration Layer in edit-site
edit-site/src/components/global-styles/(the big part here is sync between the global styles open panel and the stylebook)hooks.jsto provide auseGlobalStyles()hook that simplifies access to the default global styles. I think this could be useful as package (or within the same package) but I'm hesitant to move to the package because folks might take shortcuts when writing the UI components. (We shouldn't be reading from core-data and updating core-data from the UI component)Testing Instructions
It's a big PR, to be honest, I'd might not sure I'd have accepted a similar PR but I think it's better to than having to do all of these (100 UI components) one by one. The changes are mechanical most of the time and I don't want this migration to take forever.
I didn't test everything extensively yet but I could use some help. we need to test carefully.