Skip to content

Commit 3d3da97

Browse files
authored
Expand centered wp-block-image captions (#2089)
1 parent 9a2cdcd commit 3d3da97

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': patch
3+
---
4+
5+
Allow captions for centered WordPress Image Blocks to fill their container

src/vendor/wordpress/styles/_core-blocks.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ $wp-button-gap: size.$spacing-gap-button-group-default;
158158
max-inline-size: calc(50% - 0.5em); // 2
159159
}
160160

161+
/// By default, WordPress uses table styles to constrain captions to the size
162+
/// of the image. This makes sense for left- and right-aligned image blocks,
163+
/// but for consistency with our non-block `figure` elements, we allow
164+
/// captions to go as wide as they need for centered elements.
165+
.aligncenter {
166+
&,
167+
> figcaption {
168+
display: block;
169+
}
170+
}
171+
161172
/// Apply border only to image
162173
///
163174
/// 1. We're using 1px borders here rather than size.$edge-small because it

0 commit comments

Comments
 (0)