#58539 closed defect (bug) (fixed)
Twenty Seventeen: Image block figcaption text alignment inconsistency
Reported by: | nkeller15 | Owned by: | karmatosed |
---|---|---|---|
Milestone: | 6.6 | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | Bundled Theme | Keywords: | has-patch has-screenshots needs-testing commit |
Focuses: | css | Cc: |
Description
Steps to reproduce:
- Activate Twenty Seventeen theme
- Add an image using the image block
- Notice center alignment of caption in the editor
- Save page and view, noticing left alignment of caption now
Attachments (11)
Change History (23)
#1
@
18 months ago
- Focuses css added
- Summary changed from Twenty Seventeen - figcaption text alignment inconsitency to Twenty Seventeen: Image block figcaption text alignment inconsistency
- Version changed from 6.2.2 to 5.8
The Image block's captions have been aligned left on the front end since the block editor was made public (r43800). The discrepancy began in WordPress 5.8 when the block class list started with block-editor-block-list__block
before wp-block-image
, which made the editor styles' selector meaningless (at least for this block).
One way to fix it in the editor is adding a selector that does not require a certain order:
[class^="wp-block-"]:not(.wp-block-gallery) figcaption, [class*=" wp-block-"]:not(.wp-block-gallery) figcaption
Related: #56747
#2
@
18 months ago
- Keywords has-patch has-screenshots added
I have Tested https://core.trac.wordpress.org/attachment/ticket/58539/58539.diff Patch & It's Working Fine for me.
This ticket was mentioned in Slack in #design by grantmkin. View the logs.
10 months ago
#5
@
7 months ago
- Keywords needs-testing added
- Milestone changed from Awaiting Review to 6.6
#56747 has the same basic issue but discusses additional possibilities. This ticket could correct the mismatch for now.
58539.2.diff updates the existing rulesets to include selectors for multiple situations:
- It adds selectors with
[class*=" wp-block-"]
because that class name is not the first in the list anymore. - It uses the child combinator
[class*=" wp-block-"]:not(.wp-block-gallery) > figcaption
so the styles that do not fit the Gallery block captions do not apply to Gallery blocks within a Group or Column block (see #50376). - Selectors for RTL languages include
[dir="rtl"]
because the iframe editor does not use the.rtl
class. It probably does not need[dir="rtl"] [class^="wp-block-"]:not(.wp-block-gallery) > figcaption
, but I added that to follow the pattern.
#6
@
7 months ago
Test Report
Patch Tested: https://core.trac.wordpress.org/attachment/ticket/58539/58539.2.diff
Environment:
WordPress - 6.5.3
OS - Windows
Browser - Firefox
Theme: Twenty Seventeen
PHP - 8.1.23
Actual Results:
- Image block's Figcaption's text alignment Issue is Resolved With Patch.✅
#7
@
7 months ago
Test Report
Patch tested - https://core.trac.wordpress.org/attachment/ticket/58539/58539.2.diff
Verified the patch and it is working fine ✅
Environment
WordPress - 6.5.3
OS - Windows 11
Browser - Chrome
Theme: Twenty Seventeen
Visual
Before: https://nimb.ws/IMjpUes
After: https://nimb.ws/pwugcQ3
#8
@
7 months ago
Test Report
Patch tested: https://core.trac.wordpress.org/attachment/ticket/58539/58539.2.diff
Environment:
OS: Windows
PHP: 8.2.12
WordPress: 6.5.3
Browser: Chrome
Theme: Twenty Seventeen
Plugins: None
Actual Results:
✅ Before patch:
Screenshot: https://prnt.sc/5JDOt0AhOfdt
✅ After patch:
Screenshot: https://prnt.sc/VkjRb5xMcWgA
✅ Patch working well as desired solution
#9
@
7 months ago
- Keywords commit added
Thank you everyone, I will look into getting this committed.
Since the gallery block has the captions as centered, I've removed the left alignment causing this for consistency.