Admin page component: add isolation style for wp-ui popovers#47992
Admin page component: add isolation style for wp-ui popovers#47992
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCannot generate coverage summary while tests are failing. 🤐 Please fix the tests, or re-run the Code coverage job if it was something being flaky. |
| @@ -1,4 +1,7 @@ | |||
| .admin-page { | |||
There was a problem hiding this comment.
I don't have much context on how the project is structured: is .admin-page the root DOM node of the React app?
There was a problem hiding this comment.
Not exactly, but admin-page is the lowest node shared by all pages.
Is that a critical difference here?
There was a problem hiding this comment.
It doesn't need to be the DOM root, it just needs to be the outermost wrapper of the app content. In this case, I think .admin-page is good.
But I'd feel safer adding a code comment about those styles needing to be on the outermost wrapper of the app content — it may help in future refactors.
There was a problem hiding this comment.
BTW docs should probably note that "Within WordPress" is actually just within WP Build pages (root style), but fully custom pages built within WP Admin still need the styles added?
There was a problem hiding this comment.
Good point, I'll work on an update
There was a problem hiding this comment.
Another aspect that is recommended in the base ui docs (and we should include in our docs, too) is to add position: relative to the body element.
There was a problem hiding this comment.
We updated https://github.com/WordPress/gutenberg/blob/trunk/packages/ui/README.md#setup to refect this information, too
Now that we're using
@wordpress/uiin all headers of Admin UI as well as in other places of Jetpack UI, let's set up popovers properly as instructed in the package readme.Proposed changes
@wordpress/uito appear correctly.See https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/isolation
See setup:
No before/after since we're not using popovers yet from
@wordpress/ui, but it's easy to miss this setup rule for anyone later adding them.Other information
Related product discussion/links
Does this pull request change what data or activity we track or use?
Testing instructions