Skip to content

Fix: Update thumbnail size CSS to support YouTube's modern grid layout - #3646

Merged
ImprovedTube merged 1 commit into
code-charity:masterfrom
AryaXDG:fix-thumbnail-sizes
Feb 25, 2026
Merged

ImprovedTube merged 1 commit into
code-charity:masterfrom
AryaXDG:fix-thumbnail-sizes

Conversation

@AryaXDG

@AryaXDG AryaXDG commented Feb 25, 2026

Copy link
Copy Markdown
Member

This PR addresses layout-breaking issues associated with the "Thumbnail Size" feature on YouTube's modern grid layout and expands the feature to give users more granular control over their feeds.

YouTube recently transitioned its Home and Subscriptions feeds to a rigid CSS variable-based Grid (ytd-rich-grid-renderer). The previous legacy approach of applying percentage-based width constraints (width: 90%) directly to child elements (#thumbnail and ytd-rich-grid-media) conflicted with YouTube's internal calc() math. This resulted in unpredictable layouts, stretched images, and large empty gray spaces.

This patch refactors the thumbnail size logic to use a native CSS Grid approach at the container level, bypassing YouTube's inline variables, and introduces new user options.

Changes Included

  • Native CSS Grid Override: Replaced legacy child-width constraints with native grid-template-columns: repeat(auto-fill, ...) rules applied to the #contents container to cleanly override YouTube's grid engine.
  • Expanded Size Options: Added three new sizes to the CSS logic (and corresponding Satus menu UI): Large, Medium, and XX-Small (alongside the existing Small and X-Small).
  • Thumbnails Per Row Compatibility: Added specific :not([it-change-thumbnails-per-row="default"]) CSS overrides to ensure the new size options scale correctly when a user has a custom row count active.
  • List Layout Constraints: Applied specific pixel-width constraints for non-grid list components (Search Results, History, and Related Video sidebars) to ensure the sizes remain consistent globally.
  • Layout Cleanup: Neutralized YouTube's injected ghost items (ytd-rich-item-renderer[is-empty]) and row wrappers (display: contents on ytd-rich-grid-row) to prevent blank gaps at the bottom of the feed and ensure a fluid grid.

Screenshots
yesssss

@ImprovedTube
ImprovedTube merged commit 179bbe6 into code-charity:master Feb 25, 2026
1 check passed
@AryaXDG
AryaXDG deleted the fix-thumbnail-sizes branch March 9, 2026 18:20
@AryaXDG

AryaXDG commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

PR: #3691 should take care of those issues!

and btw back to the grind captain ;)

@AryaXDG

AryaXDG commented Apr 10, 2026

Copy link
Copy Markdown
Member Author

@ImprovedTube Thanks for the insights on the hardware limits and server rejections!

I just put together a fix for this over in #3770

It now silently probes for maxresdefault in the background to stop the 404 broken layouts, and it dynamically hides the HD options on smaller screens (basically 1000 or less pixels going horizontally from the left edge of their monitor to the right edge) to save everyone's data.

I'm ready for some more challenges to tackle, So let me know what high priority things you want me to do next and if you have any more suggestions regarding my approach!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant