-
Notifications
You must be signed in to change notification settings - Fork 32
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
PCH Smart Linking: Fix CSS leaking from the Block Preview #2652
Conversation
…nto fix/smart-link-modal-css-leak # Conflicts: # build/content-helper/editor-sidebar-rtl.css # build/content-helper/editor-sidebar.asset.php # build/content-helper/editor-sidebar.css # build/content-helper/editor-sidebar.js # src/content-helper/editor-sidebar/smart-linking/review-modal/component-block-preview.tsx # src/content-helper/editor-sidebar/smart-linking/smart-linking.scss
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Base branches to auto review (4)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Congrats on that work, this seems to be more complicated that I expected. Looking into it soon. |
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 good to me, 2 comments:
- I think a couple of introduced
@since
DocBlocks might need to be3.16.1
instead of3.16.0
. - Also wondering if we need a commend above
useEffect
.
@acicovic thank you, good catch :) |
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!
Description
As reported in #2627, some editor styles were leaking outside the block preview context in the Review modal. Although we were replacing all the
body
selectors with the specific.wp-parsely-preview-editor
class, this was not enough to isolate some selectors, such as headings.This PR changes that logic, and instead of simply replacing the body with the block preview class, it prefixes all the existing selectors with the
.wp-parsely-preview-editor
class, while also still replacing thebody
selector.Motivation and context
How has this been tested?
Tested locally with four different themes. Each theme changed the resulting block preview, and both the Modal title and sidebar headers still retain their original styling.
Screenshots (if appropriate)