Describe the bug
When an image is centered, its caption should be as well — but it isn't.
To Reproduce
Steps to reproduce the behavior:
- Embed an image block
- Center the image
- Add a caption
- Observe that the caption is centered in the post editor
- Preview the post
- Observe that the caption in the preview is left-aligned
Screenshots
Tested with Newspack Sacha 2.22.3.
Centered image in post editor:
Image embedded on frontend:
Expected behavior
Captions should consistently adhere to the alignment of its parent image.
More info
Post in question:
https://a2central.com/2026/06/libreoffice-extensions/
Relevant CSS:
|
//! Image |
|
.wp-block-image { |
|
img { |
|
display: block; |
|
} |
|
|
|
figcaption { |
|
text-align: left; |
|
} |
|
|
|
img:not([style*="object-fit"]) { |
|
height: auto !important; // !important to override inline styles. |
|
} |
|
|
|
// Preventing space under linked images; the wacky structure is to avoid affecting images from migrations that may not have ideal markup. |
|
& > a:has( img ) { |
|
display: block; |
|
} |
|
|
|
} |
Describe the bug
When an image is centered, its caption should be as well — but it isn't.
To Reproduce
Steps to reproduce the behavior:
Screenshots
Tested with Newspack Sacha 2.22.3.
Centered image in post editor:
Image embedded on frontend:
Expected behavior
Captions should consistently adhere to the alignment of its parent image.
More info
Post in question:
https://a2central.com/2026/06/libreoffice-extensions/
Relevant CSS:
newspack-theme/newspack-theme/sass/blocks/_blocks.scss
Lines 991 to 1010 in b24d6b8