Improve Rust Documentation & Reference on mobile #21133
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Just a couple of tweaks to improve the appearance of pages like The Rust Reference on mobile to advance the progress of #20850. Changing the viewport wasn't quite good enough to make it mobile-friendly, as large tables forced the page to become wider than the screen width. Using
overflow-x
, tables that are too large become horizontally scrollable instead of forcing the entire page to become horizontally scrollable.Also, there was at least one case where an extremely long piece of inline code was wider than the actual width of the screen (
std::ptr::copy_nonoverlapping_memory
), so I changedword-wrap
to allow inline code to break in the middle of words instead of only text withinpre
tags.This isn't a change included in this PR, but rather something up for discussion. Currently, code blocks that contain long lines simply wrap onto the next line. What if rather than wrapping, they were horizontally scrollable instead? I'm not sure what the general preference is regarding this.
r? @steveklabnik