-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Verse: Fix line-wrap rendering on front-end of site #28109
Conversation
Size Change: +2.09 kB (0%) Total Size: 1.3 MB
ℹ️ View Unchanged
|
@@ -1,5 +1,4 @@ | |||
pre.wp-block-verse { | |||
font-family: inherit; | |||
overflow: auto; | |||
white-space: nowrap; |
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.
In the original PR, a pre-wrap
was considered here. Should we use it explicitly instead of removing the whole thing? AFAIK the pre
tag's default white-space
value is pre
. cc @scruffian @kjellr
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 think we should use prep-wrap
so it's explicit and matches what is in the editor.
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.
It looks like the richtext editor forces a wrap regardless of what we do here:
Currently in the this PR, removing the rule (and defaulting to whitespace: pre
) keeps long words in the same line, and scrolls them horizontally if necessary:
If we did go with pre-wrap
, very long words would wrap, though not exactly the same way they do in the editor. In my testing, they wrap onto their own single line, but then don't continue wrapping beyond there, instead forcing a horizontal scroll:
So given that, I'd recommend pre-wrap
since it's closer to what the editor does in the near term. But the better solution would be to try to get the editor to mimic whitespace: pre
and stop wrapping the text.
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.
So given that, I'd recommend pre-wrap since it's closer to what the editor does in the near term
@kjellr Cool. I'm happy to help with that 👍
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.
Thanks, this seems like a good improvement for now. 👍
Thanks all! |
* Verse: Fix line-wrap rendering on front-end of site * Adjust white-space to use pre-wrap
This update fixes the front-end rendering of the text content of the Verse block.
Below is a screenshot of the correctly rendered formatted text for Verse:
Resolves: #28108
How has this been tested?
Local Gutenberg
npm run dev
Types of changes
white-space
CSS for the Verse blockChecklist: