From c3f1137eca4830328c82dfeb2e7150a0581cd04b Mon Sep 17 00:00:00 2001 From: Alan Tan Date: Thu, 7 Nov 2024 13:27:34 +0800 Subject: [PATCH 1/3] Fix auto sidebar auto sizing not resizing when related video or sidebar hide is enable --- js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css b/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css index c919a4867..67441148d 100644 --- a/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css +++ b/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css @@ -143,11 +143,13 @@ html[it-hide-playlist='true'] ytd-playlist-panel-renderer#playlist, /*-------------------------------------------------------------- # HIDE RELATED VIDEOS --------------------------------------------------------------*/ +html[it-related-videos='hidden'] #related, html[it-related-videos='hidden'] #related #contents, html[it-related-videos='hidden'] #related #dismissible, html[it-related-videos='hidden'] #related > ytd-watch-next-secondary-results-renderer > #items, html[data-page-type=video][it-related-videos='hidden'] ytd-compact-video-renderer, html[data-page-type=video][it-related-videos='hidetabs'] #related #chips, +html[it-hide-sidebar='true'] #related, html[it-hide-sidebar='true'] #related > ytd-watch-next-secondary-results-renderer > #items, html[it-hide-sidebar='true'] div#secondary div#panels, html[it-hide-sidebar='true'] div#secondary div#donation-shelf { From 435bba21b8ca4429556c76478360b3dfb36dedcf Mon Sep 17 00:00:00 2001 From: Alan Tan Date: Thu, 7 Nov 2024 13:43:59 +0800 Subject: [PATCH 2/3] Fix #2648 --- .../www.youtube.com/appearance/sidebar/sidebar.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css b/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css index 67441148d..48e4f4bfc 100644 --- a/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css +++ b/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css @@ -18,13 +18,17 @@ ytd-watch-flexy[flexy] #secondary.ytd-watch-flexy { min-width: unset !important; } +ytd-watch-flexy[flexy] #primary.ytd-watch-flexy { + max-width: calc(100vw - var(--ytd-margin-6x)) !important; +} + ytd-live-chat-frame, div#secondary div#related, div#secondary div#panels, div#secondary div#donation-shelf, div#secondary #playlist { - width: var(--ytd-watch-flexy-sidebar-width); - min-width: var(--ytd-watch-flexy-sidebar-min-width); + max-width: var(--ytd-watch-flexy-sidebar-width); + min-width: unset !important; } /*-------------------------------------------------------------- # TRANSCRIPT From ea84cf5c39f5626129a87b2685c9d082e483a58e Mon Sep 17 00:00:00 2001 From: Alan Tan Date: Thu, 7 Nov 2024 15:51:39 +0800 Subject: [PATCH 3/3] Fix #2648 --- .../appearance/sidebar/sidebar.css | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css b/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css index 48e4f4bfc..a2460e528 100644 --- a/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css +++ b/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css @@ -13,16 +13,23 @@ /*-------------------------------------------------------------- # SIDEBAR AUTO SIZING --------------------------------------------------------------*/ -ytd-watch-flexy[flexy] #secondary.ytd-watch-flexy { +html[it-hide-sidebar='true'] ytd-watch-flexy[flexy] #secondary.ytd-watch-flexy { width: auto !important; min-width: unset !important; } -ytd-watch-flexy[flexy] #primary.ytd-watch-flexy { - max-width: calc(100vw - var(--ytd-margin-6x)) !important; +html[it-hide-sidebar='true'] ytd-watch-flexy[flexy] #primary.ytd-watch-flexy { + max-width: calc(100vw - (var(--ytd-margin-6x)*2)) !important; + width: fit-content; + min-width: unset !important; +} + +html[it-hide-sidebar='true'] ytd-watch-flexy[flexy] #secondary{ + container-name: sidebar; + container-type: inline-size; } -ytd-live-chat-frame, +html[it-hide-sidebar='true'] ytd-live-chat-frame, div#secondary div#related, div#secondary div#panels, div#secondary div#donation-shelf,