Make WordPress Core

Opened 15 months ago

Closed 4 months ago

#58708 closed defect (bug) (duplicate)

Twenty Seventeen: caption alignment is different in editor and frontend

Reported by: pitamdey's profile pitamdey Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.8
Component: Bundled Theme Keywords: has-screenshots has-patch needs-testing
Focuses: css Cc:

Description

In Twenty Seventeen theme the table caption is center in the editor but it is aligned to the left in the frontend

Attachments (4)

Screenshot 2023-07-04 at 11.11.52 AM.png (57.6 KB) - added by pitamdey 15 months ago.
Editor View
Screenshot 2023-07-04 at 11.12.02 AM.png (713.9 KB) - added by pitamdey 15 months ago.
Frontend View
58708.patch (1.0 KB) - added by pitamdey 15 months ago.
after applying this patch the issue is resolved
58708.1.patch (874 bytes) - added by sabernhardt 5 months ago.
updates editor styles figcaption styles for when the block's classes list does not begin with wp-block- (refreshes 56747.patch)

Download all attachments as: .zip

Change History (12)

@pitamdey
15 months ago

after applying this patch the issue is resolved

#1 @pitamdey
15 months ago

We just have to make the apply the text align : center to the table block.
Something like this :

.wp-block-table figcaption {
    text-align: center !important;
}

#2 @sabernhardt
15 months ago

  • Summary changed from Twenty Seventeen : Table caption alignment is different in editor and frontend to Twenty Seventeen: Table caption alignment is different in editor and frontend
  • Version set to 5.8

Thanks for the report!

The figcaption for all blocks except the Gallery was set to align left, not center, in both the editor and front. However, the .wp-block-table class is not the first in the attribute within the editor, so [class^="wp-block-"] does not work there.

[class^="wp-block-"]:not(.wp-block-gallery) figcaption {
  font-style: italic;
  margin-bottom: 1.5em;
  text-align: left;
}

The patch on #56747 should fix this, too.

#3 @sabernhardt
13 months ago

  • Summary changed from Twenty Seventeen: Table caption alignment is different in editor and frontend to Twenty Seventeen: caption alignment is different in editor and frontend

#4 @sabernhardt
13 months ago

#59159 was marked as a duplicate.

#5 @sabernhardt
13 months ago

The alignment discrepancy is the same for any blocks with a figcaption: Image, Video, Table, YouTube embed, etc. It could have been caused by GB32454.

We could consider fixing the mismatch on this ticket, with 56747.patch, and then revisiting the other changes for italics on #56747.

#6 @karmatosed
5 months ago

  • Keywords has-patch added

@sabernhardt
5 months ago

updates editor styles figcaption styles for when the block's classes list does not begin with wp-block- (refreshes 56747.patch)

#7 @sabernhardt
5 months ago

  • Keywords needs-testing added

For clarity about which patch to test, I attached the patch from the other ticket (and refreshed it).

#8 @sabernhardt
4 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This issue was reported previously on #58539, and this patch needed to be updated anyway.

Note: See TracTickets for help on using tickets.