Skip to content

Instantly share code, notes, and snippets.

@Abhinav1217
Last active June 26, 2025 13:11
Show Gist options
  • Select an option

  • Save Abhinav1217/68e77d14f17b7f59dbc5f92630361009 to your computer and use it in GitHub Desktop.

Select an option

Save Abhinav1217/68e77d14f17b7f59dbc5f92630361009 to your computer and use it in GitHub Desktop.
youtube.userstyles.css
/* ==UserStyle==
@name Undistracted Youtube
@namespace userstyles.world
@version 0.0.5
@description Undistracted Youtube
@author Abhinav K
@preprocessor stylus
@var checkbox checkbox-shorts "Hide Shorts" 1
@var checkbox checkbox-sidebar-discovery "Hide Sidebar: Discovery" 1
@var checkbox checkbox-video-recommended "Hide Video: Recommended" 0
@var checkbox checkbox-disable-inline-playback "Disable Inline Playback" 1
@var number items-per-row 'Thumbnails per row' [5, 1, 10]
==/UserStyle== */
@-moz-document domain('youtube.com') {
/**
This has inspiration from many existing userstyles.
*/
:root {
/* set maximum no of rows */
--items-per-row: items-per-row;
}
ytd-rich-grid-renderer {
--ytd-rich-grid-items-per-row: var(--items-per-row) !important;
--ytd-rich-grid-posts-per-row: var(--items-per-row) !important;
--ytd-rich-grid-slim-items-per-row: var(--items-per-row) !important;
--ytd-rich-grid-game-cards-per-row: var(--items-per-row) !important;
--ytd-rich-grid-mini-game-cards-per-row: var(--items-per-row) !important;
--ytd-rich-grid-item-max-width: 450px !important;
--ytd-rich-grid-item-min-width: 250px !important;
}
ytd-rich-item-renderer[rendered-from-rich-grid][is-in-first-column] {
margin-left: 0;
}
if checkbox-shorts {
/* remove shorts, breaking news, you might like, etc */
a[title="Shorts"],
[page-subtype='home'] ytd-rich-shelf-renderer[is-shorts],
ytd-reel-shelf-renderer,
/* for when the name "shorts" isn't used **NB: if you use blocktube, then keep these commented. */
/* enable below line if you are not using blocktube */
/* #sections .ytd-guide-renderer:first-child ytd-guide-entry-renderer:nth-child(2), */
/* .style-scope .ytd-mini-guide-renderer:nth-child(2), */
body:not(body) {
display: none !important;
}
/* BlockTube is much better addon but this will work most of the time. */
}
ytd-rich-section-renderer {
display: none !important;
}
if checkbox-sidebar-discovery {
#sections {
ytd-guide-section-renderer:nth-child(3),
ytd-guide-section-renderer:nth-child(4),
ytd-guide-section-renderer:nth-child(5),
ytd-guide-section-renderer:nth-child(6),
ytd-guide-signin-promo-renderer {
display: none !important;
}
}
#footer.ytd-guide-renderer {
display: none !important;
}
}
/* Hide channel in play next section */
ytd-watch-next-secondary-results-renderer ytd-channel-renderer {
display: none
}
panels-full-bleed-container,
#chat-container,
#teaser-carousel,
ytd-live-chat-frame {
display: none !important;
}
ytd-watch-flexy[flexy][use-larger-max-player-value]:not([full-bleed-player][full-bleed-no-max-width-columns]) #columns.ytd-watch-flexy {
padding-right: 0rem !important;
}
ytd-watch-flexy[fixed-panels] #panels-full-bleed-container.ytd-watch-flexy,
ytd-watch-flexy[squeezeback] #panels-full-bleed-container.ytd-watch-flexy,
ytd-watch-flexy[panels-beside-player] #panels-full-bleed-container.ytd-watch-flexy {
width: 0;
}
#offer-module {
display: none;
}
if checkbox-disable-inline-playback {
ytd-video-preview,
ytd-moving-thumbnail-renderer {
display: none;
}
}
if checkbox-video-recommended {
#secondary-inner {
display: none !important;
}
:not(.ytp-mweb-player) .ytp-endscreen-paginate {
.ytp-endscreen-next,
.ytp-endscreen-previous {
display: none;
}
}
.ytp-endscreen-content {
display: none;
}
}
/* video thumb margins */
#contents ytd-rich-item-renderer ytd-rich-shelf-renderer {
margin-top: 15px !important;
margin-left: 10px !important;
margin-right: 10px !important;
margin-bottom: 15px !important;
}
#contents ytd-rich-item-renderer.ytd-rich-grid-renderer {
margin-top: 15px !important;
margin-left: 10px !important;
margin-right: 10px !important;
margin-bottom: 15px !important;
}
/*search thumbnail size*/
ytd-video-renderer[use-search-ui] ytd-thumbnail.ytd-video-renderer {
max-width: 300px !important;
}
/* show "latest, popular, oldest" at channel page */
ytd-feed-filter-chip-bar-renderer[component-style="FEED_FILTER_CHIP_BAR_STYLE_TYPE_CHANNEL_PAGE_GRID"] yt-chip-cloud-chip-renderer {
display: inline-block !important;
}
ytd-channel-renderer {
border: 5px solid #3c3a3a;
border-radius: 10px;
padding: 1.5rem 1rem;
margin: 0;
}
ytm-paid-content-overlay-renderer {
display: none !important;
}
/* Hide youtube Create button. */
button[aria-label="Create"] {
display: none !important;
}
/* front page smaller text and spacing */
ytd-rich-item-renderer #video-title.ytd-rich-grid-media {
font-size: 1.3rem !important;
line-height: 1.8rem !important;
}
ytd-rich-item-renderer h3.ytd-rich-grid-media {
margin: 6px 0 5px 0 !important;
}
ytd-video-meta-block[rich-meta] #byline-container.ytd-video-meta-block,
ytd-video-meta-block[rich-meta] #metadata-line.ytd-video-meta-block {
font-size: 1.3rem !important;
line-height: 1.1rem !important;
}
ytd-guide-collapsible-section-entry-renderer.ytd-guide-section-renderer {
/*margin-top: 0px !important;*/
font-size: 1rem !important;
}
/* hide miniplayer button */
.ytp-chrome-controls > .ytp-right-controls > button.ytp-miniplayer-button {
display: none !important;
}
/* Stupid shorts are huge */
ytm-shorts-lockup-view-model-v2 ytm-shorts-lockup-view-model .shortsLockupViewModelHostThumbnailContainer,
.shortsLockupViewModelHostThumbnailContainer > img {
height: 400px;
}
}
@Abhinav1217
Copy link
Author

User style is located at https://userstyles.world/style/22020

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