Repository navigation
Conversation
|
Size Change: +53 B (0%) Total Size: 7.73 MB 📦 View Changed
|
|
I will soon start the release process for 7.1 RC1. Let's consider releasing this PR for RC2 if possible. |
|
The one risk factor for breakage here is that this adds one extra div wrapper to the I found one possibly affected case in the experimental |
|
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. |
t-hamano
left a comment
There was a problem hiding this comment.
I might be missing something, but what do you think about inverting the seed?
packages/edit-site/src/components/layout/index.js
<SlotFillProvider>
<Tooltip.Provider>
{ /** This needs to be within the SlotFillProvider */ }
<PluginArea onError={ onPluginAreaError } />
<ThemeProvider
isRoot
color={ {
primary: themeColors.primary,
...CONTENT_COLOR,
} }
>
<ThemeProvider color={ themeColors }>
<Layout { ...props } />
</ThemeProvider>
</ThemeProvider>
</Tooltip.Provider>
</SlotFillProvider>I believe this is an approach also used in the boot package.
gutenberg/packages/boot/src/components/root/index.tsx
Lines 69 to 73 in e8bc5cd
|
@t-hamano Good point, not sure how I missed that approach 😅 I have tested that on the 7.1 branch and verified that it's sufficient. Since the correct long-term fix is the one in this PR where we wrap |
|
Am I correct in understanding that since #81296 has landed for the 7.1 branch and we still think this is the better long-term solution, we'll want to rebase this, merge it to trunk without a backport and have it land in a future release? Do we want to explicitly undo the changes in #81296 at any point or do those continue to be valid? |
Correct. I'll check whether any of the section-level
I was thinking that can remain in the 7.1 branch indefinitely. Any concerns? |
|
No concerns 👍 Just wanted to clarify my understanding of long-term vs. short-term fix if we need to make a point to remove the short-term fix. |
|
Oh, I guess if it was committed directly to |
|
Flaky tests detected in eeab756. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/31827084354 adds and activates a new tab when pressing Enter at the end of a tab label in
|
|
I did some more testing, and realized that I was too optimistic about this approach. There seems to be about 10+ popover/modals that are triggered open from the dark mode chrome, and most of those are not theme-ready yet. What's worse is that some of the theming gets applied, and what results is a very broken state like:
If it were just a few occurrences, maybe we could just wrap those instances in a So all in all, I don't think we're ready to enable "real" dark mode at this scale on legacy componentry yet. It only works in the sidebar chrome because the non-portaled content is fairly simple, and often customized locally to support theming. Bringing back the inverted approach to trunk in #81653. |
|
Closing in favor of the new strategy in #82038 |

What?
Wraps
@wordpress/componentsPopoverandModalcontent inThemeProvider.Follow up to #81112. Supersedes #81178.
Why?
Portaled popovers and modals render outside their ancestor
ThemeProviderwrapper in the DOM, so they do not receive the CSS custom properties emitted on that wrapper even though React context is preserved. WPDS-styled UI inside popovers and modals (buttons, inputs, etc.) can therefore miss admin color scheme tokens.This matches the pattern already used by
@wordpress/uipopup primitives (Popover.Popup,Dialog.Popup,Select.Popup,Tooltip.Popup, etc.), which wrap their portaled content inThemeProviderto reapply inherited seed values.Specifically as a backport fix for 7.1
We have a 7.1 regression where certain popovers and modals in the site editor do not inherit the admin color properly.
Simply using
isRooton an editor layout provider was considered as the quickest fix (#81178). However, unlike the block editor which only needs one accent color, the site editor sets an admin scheme color as a background color on the outer UI chrome. This means that this outer background color (not white) would apply to portaled popovers, which is not what we want. We do in fact need React-tree-based theme inheritance to fix this.How?
<ThemeProvider>(no color prop), so inherited settings from ancestor providers are re-emitted on the popover wrapper.<ThemeProvider>insideStyleProvider, for the same reason.Testing Instructions
npm start)./wp-admin/site-editor.php).DataViews"View options" dropdown in Pages, dropdown menus or font modal in Styles.This should also work correctly when cherry picked onto the
wp/7.1branch.