Skip to content

Fix sidebar widening with oversized content - #2246

Merged
melroy89 merged 2 commits into
mainfrom
fix/sidebar-content-width
Oct 9, 2026
Merged

melroy89 merged 2 commits into
mainfrom
fix/sidebar-content-width

Conversation

@melroy89

@melroy89 melroy89 commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Wide tables in community descriptions stretched the sidebar because its grid item retained an automatic minimum width. Setting min-width: 0 lets the sidebar shrink while tables scroll within their existing wrapper.

Root-cause is this donation button in the description on https://kbin.melroy.org/m/piracy@lemmy.dbzer0.com:

image

Before:

image

After:

image

@melroy89
melroy89 requested a review from blued-gear October 9, 2026 18:45
@melroy89 melroy89 added bug Something isn't working frontend Visual issues, improvements, bugs or other aspects relating mostly to the front end labels Oct 9, 2026
@melroy89
melroy89 enabled auto-merge (squash) October 9, 2026 18:48
@blued-gear

Copy link
Copy Markdown
Collaborator

The min-width is a common problem with grid items. That's why I planned to introduce a helper CSS class grid-minw-0 which is supposed to be applied to the grid and the rule matches all its immediate items.

As you already created this PR, do you want to implement that?

@melroy89

melroy89 commented Oct 9, 2026 •

Copy link
Copy Markdown
Member Author

The min-width is a common problem with grid items. That's why I planned to introduce a helper CSS class grid-minw-0 which is supposed to be applied to the grid and the rule matches all its immediate items.

As you already created this PR, do you want to implement that?

TO better match a commonly used name, like tailwind, I called it .grid-min-w-0 if you do not mind. This also helps to easily onboard new devs as well.

I also want to add more classes now, like: .flex-col, .items-center, .justify-between various .gap-* classes and also just a.min-w-0 class that directly applies to the element itself, instead of children. As well as .shrink-0, .flex-1 and maybe even .grid-cols-2 for two equal column that can shrink.

@melroy89

melroy89 commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Optional follow PR with more CSS helpers that use the same naming convention is here: #2247

@melroy89
melroy89 merged commit 15f4413 into main Oct 9, 2026
9 checks passed
@melroy89
melroy89 deleted the fix/sidebar-content-width branch October 9, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend Visual issues, improvements, bugs or other aspects relating mostly to the front end

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants