Skip to content
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

[standard.css] Consider using break-word regardless of viewport width #188

Open
donovanglover opened this issue Mar 1, 2018 · 8 comments

Comments

@donovanglover
Copy link
Contributor

Some WHATWG specs don't fit smaller viewport sizes. I'm not sure how many specs are affected, but I did find one prominent example.

Consider: https://fetch.spec.whatwg.org/#cors-protocol-examples

Here the API key causes the page to overflow on (smaller) viewports greater than 767px. It may be best to just use word-wrap: break-word; all the time to avoid this issue.

@domenic
Copy link
Member

domenic commented Mar 1, 2018

Works fine in Chrome and Firefox on Android. What are you testing with?

You can scroll horizontally because of the table above, but next to the linked example there's only whitespace.

@donovanglover
Copy link
Contributor Author

This issue occurs on a desktop (or any) browser with a viewport width greater than 767px but less than the amount required for long lines like these to be rendered without overflowing the box.

The minimal width required to prevent this issue from happening varies between systems since they use different fonts, but for me this threshold was around 1000px (for https://fetch.spec.whatwg.org/#cors-protocol-examples).

@domenic
Copy link
Member

domenic commented May 11, 2019

Here is a screenshot of the issue:
image

In my opinion we should indeed do something here. I see two reasonable options:

  • Preserve author intent, and don't wrap on desktop (> 767px viewports) unless there are lines in the source text. This would mean moving from pre { white-space: pre-wrap } to pre { white-space: pre }
  • Say that we want to avoid scrollbars as much as possible, by using pre { word-wrap: break-word } even on desktop.

I think our current state is a bad intermediate.

Do folks have opinions?

@annevk
Copy link
Member

annevk commented May 14, 2019

I cannot reproduce this in Chrome or Firefox. I don't see any horizontal scrollbars. The text is wrapped further.

@domenic
Copy link
Member

domenic commented May 14, 2019

Once you get a viewport width below 767px, it is, since then our mobile styles kick in. But between 767px and wide-enought-to-fit-the-GUID-on-one-line, there's wrapping.

@annevk
Copy link
Member

annevk commented May 14, 2019

I suspect I'm missing something, but I cannot get horizontal scrollbars however small I make the width:
Screenshot 2019-05-14 at 15 52 27

@domenic
Copy link
Member

domenic commented May 14, 2019

Sorry, I misspoke. Above 767px is where they kick in. (Until you make it wide enough that everything fits anyway.) Try for window.clientWidth === 770px or so.

@annevk
Copy link
Member

annevk commented May 14, 2019

Aah, I tried that too, but what I did not notice is that the scrollbars are not visible by default and since the URL contains a lot of noise that was not very clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants