Opened 3 years ago
Last modified 3 months ago
#56341 new defect (bug)
Twenty Twenty-Two: Long text strings cause horizontal overflow
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.0 |
Component: | Bundled Theme | Keywords: | has-patch needs-testing |
Focuses: | css | Cc: |
Description
When viewed on narrow viewports, long strings will overflow outside the main content area.
Older bundled themes would default to word-break: break-all
to avoid this and I believe that Twenty Twenty-Two should also work this way by "pushing" long strings into multiple lines.
The code below can be used as a temporary workaround.
.wp-site-blocks * { word-break: break-all; }
Attachments (3)
Change History (12)
#1
@
3 years ago
- Focuses css added
- Summary changed from [Twenty Twenty-Two] Long text strings cause horizontal overflow to Twenty Twenty-Two: Long text strings cause horizontal overflow
#2
@
3 years ago
Adding word-wrap: break-word;
in .wp-site-blocks
solves the issue. overflow-wrap: break-word
can also be used instead of word-wrap but for better cross-browser support I guess it would be wise to use word-wrap.
Also the CSS property can be added directly to the existing styles, see this screenshot - https://prnt.sc/c_6yhnRfbKhH, but as there are some other classes added so it might create side effects. Thus, my thoughts are as per @sabernhardt to add the style separately within .wp-site-blocks
. I have added patch with the fix.
#4
@
3 years ago
Thank you for looking into this @tahmidulkarim & @sabernhardt.
The solution I put forward was just a first attempt and very likely imprecise or partial. For context, this problem came up originally in this support thread: https://wordpress.org/support/topic/naked-links-in-content-area-not-responsive-on-mobile-thus-causing-overflowing/.
#6
@
4 months ago
Would this solve the problem?
https://github.com/WordPress/gutenberg/issues/55190
#7
@
3 months ago
I think it would @poena and it solves outside of the theme so for me is better. I am going to recommend we go with that over patching the theme.
This ticket was mentioned in Slack in #core-test by satishprajapati. View the logs.
3 months ago
#9
@
3 months ago
==Test Report
Environment
WordPress - 6.7.1
Chrome Version - Version 131.0.6778.205
OS - macOS Ventura Version: 15.1.1
Theme: Twenty Twenty-Two Version: 1.9
PHP - 8.1.29
Web Server - nginx
Database - MySQL 8.0.16
Actual Results
I recreated this issue on local and tried to solve with the given patch. The issue was resolved using the patch. Issue was with the CSS.
Breaking text in every element by default, with the universal
*
selector, has caused an issue with trying to use CSS grid in Twenty Twenty (#48637).It might be worth putting the style on the site container, though (using
word-wrap
—see ticket:37617#comment:7):(The example given on the other ticket would still need editing, but only on its container element.)
Some blocks already wrap text for any theme:
overflow-wrap: break-word
.overflow-wrap: break-word
(if your link had been inside the embed caption, it would have wrapped).word-break: break-word
.word-break: break-word
.I only found two cases of
break-all
in the 12 bundled themes: table cells in Twenty Nineteen and Twenty Twenty's mobile menu toggle button text. However,break-word
is far more common.