-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix content breaking out of main container #84
Conversation
This was creating an overflow to the right on Chrome
@@ -16,7 +16,6 @@ | |||
margin-top: var(--wp--custom--margin--baseline); | |||
|
|||
> label { | |||
width: 100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this in the right PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this causes the content to break out of the screen when the search is in a sidebar.
@@ -0,0 +1,5 @@ | |||
.wp-block-preformatted { | |||
white-space: pre; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed the content there — looks like it was hit by this shortcode issue, it was not meant to actually embed any videos. If a video is embedded not in a pre
, it should wrap the error message just fine.
I'm still getting the issue I commented on on this page . Should we address this here? Its probably likely that other examples exist. |
I didn't fix that because that page is unpublished, no one will see it (in fact it should redirect to https://developer.wordpress.org/advanced-administration/before-install/howto-install/ now). The cause of the issue was the content itself- the image was copied over from maybe the Codex? with extra styles/classes. It's the only article I can find using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I tested works well. 👍
We can open new tickets for more example that are found.
Fixes WordPress/wporg-documentation-2022#50 — Force a word break on content so that the text wraps rather than breaking out of the container.
This also removes the wrap from
pre
blocks, since they're usually code and the wrap distorts the indentation.Screenshots
Three examples from Docs, and one from About, to show this works across the child themes.
Docs
Docs
About
No difference, already works
https://wordpress.org/documentation/article/twenty-twenty-changelog/ — For this one I edited the article itself to remove the
s between the words, which along with the break-word rule correctly wraps on small screens.https://wordpress.org/documentation/article/what-are-smilies/ — This was another page with slightly malformed content, the table block was missing the figure wrapper. Just by updating the page I fixed the table display and now it overflows with a scroll instead of breaking the container.
How to test the changes in this Pull Request: