-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Media & Text block: Fix nested Media & Text block media position issue with increased CSS specificity #62184
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. |
The same issue is also happening with the block's vertical alignment: if I change the outer block's vertical alignment to bottom then the inner block's vertical alignment doesn't work. So I have added the |
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 for the PR!
This PR works as expected, but we might also want to fix the issue where the layout affects nested blocks when "Stack on mobile" is enabled.
Just make the following changes:
diff --git a/packages/block-library/src/media-text/style.scss b/packages/block-library/src/media-text/style.scss
index d5da67b5e4..8a880fbab4 100644
--- a/packages/block-library/src/media-text/style.scss
+++ b/packages/block-library/src/media-text/style.scss
@@ -108,11 +108,11 @@
@media (max-width: #{ ($break-small) }) {
.wp-block-media-text.is-stacked-on-mobile {
grid-template-columns: 100% !important;
- .wp-block-media-text__media {
+ > .wp-block-media-text__media {
grid-column: 1;
grid-row: 1;
}
- .wp-block-media-text__content {
+ > .wp-block-media-text__content {
grid-column: 1;
grid-row: 2;
Thanks for reviewing the PR. I apologize for missing this 😅 |
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.
…e with increased CSS specificity (WordPress#62184) * Refactor media-text layout styles * Update media-text alignment styles to support nested media-text blocks * Update media-text layout for mobile view Co-authored-by: amitraj2203 <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: carolinan <[email protected]>
Should this be backported for WP 6.6? If so, please add the |
This issue isn't new to WP6.6, but I think it's a great fix, so let's backport it to WP6.6. |
…e with increased CSS specificity (#62184) * Refactor media-text layout styles * Update media-text alignment styles to support nested media-text blocks * Update media-text layout for mobile view Co-authored-by: amitraj2203 <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: carolinan <[email protected]>
…e with increased CSS specificity (#62184) * Refactor media-text layout styles * Update media-text alignment styles to support nested media-text blocks * Update media-text layout for mobile view Co-authored-by: amitraj2203 <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: carolinan <[email protected]>
…e with increased CSS specificity (WordPress#62184) * Refactor media-text layout styles * Update media-text alignment styles to support nested media-text blocks * Update media-text layout for mobile view Co-authored-by: amitraj2203 <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: carolinan <[email protected]>
This was cherry-picked to the wp/6.6 branch. |
What?
Fix: #62047
Why?
When we add a
Media & Text
block and set the media position to the right with the toolbar setting, and then insert a secondMedia & Text
block in the block's content area: Then the media position option in the secondMedia & Text
block does not work.How?
Adds
>
to relevant CSS selectors.Testing Instructions