StackExchange / StackExchange/Stacks

Grid spacing classes force horizontal scroll when grid items wrap

Open
#328 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
672
Forks
107
Avg merge
2d 12h
Merged PRs (30d)
26

Description

When using our grid spacing classes responsively, they force a horizontal scroll when wrapping. This is the smallest example that will trigger this.

<div class="grid gs64 fw-wrap">
    <div class="grid--cell">
        This cell has dynamic content that ought to wrap with the window
    </div>
    <div class="grid--cell">
        This cell has dynamic content that ought to wrap with the window
    </div>
    <div class="grid--cell">
        This cell has dynamic content that ought to wrap with the window
    </div>
    <div class="grid--cell">
        This cell has dynamic content that ought to wrap with the window
    </div>
    <div class="grid--cell">
        This cell has dynamic content that ought to wrap with the window
    </div>
</div>

At smaller window sizes, this forces a horizontal scroll.

Workaround

You can add an overflow-x-hidden to your parent for now, but we ought to solve the underlying issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied grid markup at smaller window sizes and inspect the grid spacing classes used by grid gs64 fw-wrap. Done means wrapped grid items no longer force horizontal scrolling without relying on the overflow-x-hidden workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
design, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.