Opened 2 years ago
Last modified 4 months ago
#56341 new defect (bug)
Twenty Twenty-Two: Long text strings cause horizontal overflow
Reported by: | mrfoxtalbot | 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 (8)
#1
@
2 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
@
2 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
@
2 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/).
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.