Skip to content

Commit ffe690e

Browse files
Reader: Fix left/right aligned images struggling paragraphs (#109104)
* Fix image sizing when it is followed by a paragraph When the user set align-left/right to a image, we were not protecting the image to use too much space and struggle the content. This change ensure the content is not struggled only if the next element is a p * Improve selector
1 parent 712ea77 commit ffe690e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

client/assets/stylesheets/shared/_rendered-blocks.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@
111111
margin-bottom: 12px;
112112
margin-left: 32px;
113113
}
114+
115+
/**
116+
* Sometimes we have figure inside the div.wp-block-image, in other cases we have figure.wp-block-image
117+
*/
118+
figure.wp-block-image:is(.alignleft, .alignright):has( + p),
119+
.wp-block-image:has(figure.alignleft, figure.alignright):has( + p) {
120+
max-width: 40%;
121+
}
114122
}
115123

116124
@include breakpoint-deprecated( "<660px" ) {

0 commit comments

Comments
 (0)