Fix responsive behaviour for wide content #9587
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.
Fix responsive layout breaking due to non-wrapping content (mainly code blocks) overflow
Problem
The documentation site's responsive layout was breaking on large desktop screens (1200px+) when pages contained code blocks with long lines. The issue manifested as:
The main container was using
w-fit-content
, which instructed it to size itself to accommodate its content (including wide code blocks) rather than constraining content to fit available space. This created a cascade where:w-fit-content
) expanded to fit articleSolution
A minimal fix with just two changes:
w-fit-content
tow-full
How It Works
w-full
: Prevents the main container from expanding beyond viewport widthflex: 1 1 0%
+width: 0
: Forces the article to shrink properly in flexbox layouts on large screens where the problem occursTesting
To test this, build this branch and take a look at a page with wide content, such as: https://circleci.com/docs/reference/configuration-reference/ compare the responsiveness in production and this branch