fix: prevent text overflow on narrow screens - #2207
Open
luozejian wants to merge 1 commit into
Open
Conversation
|
@luozejian is attempting to deploy a commit to the Svelte Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Before submitting the PR, please make sure you do the following
feat:,fix:,chore:, ordocs:.Fixes #530
Problem
On narrow mobile viewports, consecutive inline code elements separated by punctuation could expand the documentation content beyond the viewport.
On the Svelte 5 migration guide, the
clientWidth/clientHeight/offsetWidth/offsetHeightsequence caused horizontal scrolling. As a result, the bottom previous/next navigation appeared to be hidden outside the viewport.Solution
Allow regular content rendered by the shared
Textcomponent to wrap when necessary, while keeping inlinecodeandkbdtokens intact.This lets the browser wrap consecutive inline code elements at their separators instead of breaking identifiers or expanding the page width.
This PR only changes the shared
Textcomponent styling. It does not modify synced documentation content.Validation
At a 320px viewport:
scrollWidthwas 350pxscrollWidthis 320pxAlso verified at a 360px viewport.
The following checks pass:
pnpm --filter @sveltejs/site-kit lintpnpm --filter @sveltejs/site-kit checkpnpm --filter svelte.dev checkpnpm build