YouTube Live Borderless

Make YouTube Live Borderless

目前为 2023-05-25 提交的版本。查看 最新版本

  1. /* ==UserStyle==
  2. @name YouTube Live Borderless
  3. @version 0.5.7
  4. @namespace github.com/cyfung1031
  5. @license MIT
  6. @description Make YouTube Live Borderless
  7. @author CY Fung
  8. @supportURL https://github.com/cyfung1031/YouTube-Live-Borderless/
  9. @compatible edge Edge [Blink] >= 105; Stylus (Beta)
  10. @compatible chrome Chrome >= 105; Stylus (Beta); Chrome 101-104 requires "enable-experimental-web-platform-features"
  11. @compatible firefox FireFox >= 103; Stylus; layout.css.has-selector.enabled = true; note: some features might not be very stable!!
  12. @compatible opera Opera >= 91; Stylus (Beta)
  13. @compatible safari Safari >= 15.4; Stylus
  14. @preprocessor stylus
  15. @var checkbox youtube-wpr "YouTube WPR" 0
  16. @var select mode-for-two-col "Mode ##TwoColumns" {
  17. "Expanded Panel Only #Recommended": "expanded-panel",
  18. "Expanded Live Chat Only": "expanded-live",
  19. "Expandable Live Chat Only": "expandable-live",
  20. "Always": "always"
  21. }
  22. @var select mode-for-single-col "Mode ##SingleColumn" {
  23. "YT Mobile #Recommended": "mobile",
  24. "Normal": "normal",
  25. "Disabled": "disabled"
  26. }
  27. @var checkbox no-masthead "Top.MastheadBar ::Hide" 0
  28. @var range masthead-hoverable-height "Top.MastheadBar ::Hoverable" [12, 0, 36, 2, 'px']
  29. @var range masthead-hoverable-delay-in "Top.MastheadBar ::Hoverable.DelayIn" [300, 0, 800, 100, 'ms']
  30. @var checkbox disable-cinematics "CinematicsEffect ::Disable" 0
  31. @var range video-enlarging "Video.Enlarging >>>Video.Border.Fine.Tune" [0, 0, 8, 2]
  32. @var range video-padding-left-right "Video.Padding.LeftRight (Experimental)" [0, 0, 18, 2, 'px']
  33. @var range video-padding-top-bottom "Video.Padding.TopBottom (Experimental)" [0, 0, 18, 2, 'px']
  34. @var range primary-content-margin "PrimaryContent ::Margin" [24, 6, 48, 6, "px"]
  35. @var range video-title-size "VideoTitle ::Size" [2.0, 1.0, 3.0, 0.2, "rem"]
  36. @var checkbox no-bottom-row "Bottom.PrimaryMetaInfoRow ::Hide" 0
  37. @var range min-below-area "BelowArea ::Minimum" [120, 0, 240, 10, 'px']
  38. @var range min-below-area-for-theater "WideTheater.BelowArea ::Minimum" [120, 0, 240, 10, 'px']
  39. @var number side-panel-width "SidePanel ::Width" [440, 320, 640, 20, "px"]
  40. @var checkbox no-round-border "RoundBorder ::Disable" 1
  41. @var number chat-zoom-for-right-col "RightCol.Chat ::Zoom" [1.0, 0.4, 1.2, 0.05]
  42. @var range chat-btn-height "RightCol.Chat ::SpaceAbove@Zoom" [36, 0, 60, 4, 'px']
  43. @var number chat-zoom-for-mobile "YTMobile.Chat ::Zoom" [1.0, 0.4, 1.2, 0.05]
  44. @var range chat-min-height "YTMobile.Chat ::Min.Height" [400, 20, 900, 10, 'px']
  45. @var checkbox t34 "Disable Some CSS Rules for laggy page" 0
  46. ==/UserStyle== */
  47. /*
  48.  
  49. @var range chrome-bottom-bar-margin "Chrome Bottom Bar Margin" [12, 6, 48, 6, "px"]
  50.  
  51. Chrome Bottom Bar Margin is 12px only due to
  52.  
  53. MU = function(a) {
  54. var b = a.u.ag()
  55. , c = a.G.getVideoData().D
  56. , d = 0;
  57. a.u.ag() && a.u.Me() && (d = (a.G.fb().getPlayerSize().width - a.G.getVideoContentRect().width) / 2);
  58. return 12 * (c ? 0 : b ? 2 : 1) + d
  59. }
  60.  
  61. */
  62. // d
  63. t33 = t34
  64. @-moz-document url-prefix("https://www.youtube.com/watch?v=") {
  65.  
  66. dummy() {
  67. // dummy
  68. border: 0;
  69. }
  70. buildL4(type, args...) {
  71. st1 = join('', ':', type, '(', join('\, ', args), ')')
  72. selector(st1)
  73. }
  74.  
  75. /*
  76. if min-below-area <= 10px {
  77. min-below-area = 0px
  78. }
  79. if min-below-area-for-theater <= 10px {
  80. min-below-area-for-theater = 0px
  81. }
  82. */
  83. chat-btn-height = chat-btn-height + 1px
  84. if chat-btn-height == 0px + 1px {
  85. chat-btn-height = 0px
  86. }
  87. // masthead-hoverable-height = (masthead-hoverable-h - 1) * 2px
  88.  
  89. no-masthead-w = no-masthead //
  90. chrome-bottom-bar-margin = 12px // this cannot be changed
  91.  
  92. single-col-mobile = (mode-for-single-col == "mobile" ? 1 : 0) //
  93. if single-col-mobile == 1 and no-masthead-w == 0 {
  94. no-masthead-w = 2 //
  95. }
  96. chat-zoom-for-mobile-enable = ((chat-zoom-for-mobile < 1) or (chat-zoom-for-mobile > 1))
  97.  
  98. content361(){
  99. html {
  100. --ylb-min-below-area: min-below-area;
  101. }
  102. // general fix
  103. ytd-watch-flexy[theater] #player-theater-container.ytd-watch-flexy {
  104. min-height: unset;
  105. }
  106. #movie_player .ytp-cued-thumbnail-overlay-image {
  107. /* background-size: contain !important; */
  108. background-size: auto 100% !important;
  109. }
  110. ytd-watch-flexy:not([is-two-columns_]) ytd-watch-metadata {
  111. padding-top: var(--ytd-margin-3x);
  112. }
  113. ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]) #primary.ytd-watch-flexy {
  114. padding-top: 0;
  115. margin-top: 0;
  116. }
  117. m = youtube-wpr ? ':not([tabview-loaded])[youtube-wpr*="h2"]': ":not([tabview-loaded]):has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)"
  118. html{selector(m)} {buildL4('is',
  119. '#primary-inner.ytd-watch-flexy ytd-comments#comments.ytd-watch-flexy',
  120. '#secondary-inner.ytd-watch-flexy > #related.ytd-watch-flexy')} {
  121. display: none !important;
  122. }
  123. html:not([tabview-loaded]) #cinematics {
  124. // contain: layout;
  125. contain: layout size style;
  126. user-select: none;
  127. touch-action: none;
  128. pointer-events: none;
  129. }
  130.  
  131.  
  132. }
  133.  
  134. //
  135. contentNoMasthead() {
  136.  
  137. // root = html
  138. & {
  139. /* 0px not 0 */
  140. --ytd-masthead-height: 0px;
  141. --ytd-toolbar-height: 0px;
  142. --ytd-watch-flexy-masthead-height: 0px;
  143. }
  144. /*
  145. & ytd-watch-flexy {
  146. --ytd-watch-flexy-masthead-height: 0px;
  147. }
  148. */
  149. /*
  150. #masthead-container + ytd-page-manager#page-manager
  151. has margin-top var(--ytd-masthead-height,var(--ytd-toolbar-height))
  152. */
  153. ytd-app[style] { /* YouTube set the masthead-height in style */
  154. --ytd-masthead-height: 0px !important;
  155. --ytd-toolbar-height: 0px !important;
  156. --ytd-watch-flexy-masthead-height: 0px !important;
  157. }
  158. & .style-scope{buildL4('is', '#page-manager', 'ytd-watch-flexy', 'ytd-page-manager')} {
  159. --ytd-masthead-height: 0px;
  160. --ytd-toolbar-height: 0px;
  161. --ytd-watch-flexy-masthead-height: 0px;
  162. }
  163.  
  164. #masthead-container {
  165. height: 0;
  166. --masthead-opacity: 0;
  167. opacity: var(--masthead-opacity) !important;
  168. transition: opacity 300ms;
  169. min-height: masthead-hoverable-height;
  170. contain: layout size style;
  171. }
  172.  
  173. #masthead-container > ytd-masthead {
  174. transform: translateY(-100%);
  175. transition: transform 300ms;
  176. }
  177.  
  178.  
  179. if masthead-hoverable-height > 0 {
  180.  
  181. ytd-app {
  182. --ut-masthead-background: rgba(15,15,15,0.8);
  183. }
  184. ytd-app[darker-dark-theme] {
  185. --ut-masthead-background: rgba(240,240,240,0.8);
  186. }
  187. ytd-masthead#masthead:hover {
  188. background-color: color(--ut-masthead-background);
  189. z-index: 9999 !important;
  190. }
  191.  
  192. ytd-masthead#masthead {
  193. background-color: rgba(15,15,15,0.8);
  194. z-index: 9999 !important;
  195. }
  196.  
  197. #masthead-container:hover {
  198. --masthead-opacity: 1;
  199. }
  200.  
  201. #masthead-container:hover > ytd-masthead {
  202. transform: translateY(0%);
  203. transition-delay: masthead-hoverable-delay-in;
  204. }
  205.  
  206. #masthead-container::after {
  207. content: '';
  208. display: flex;
  209. width: 100%;
  210. height: masthead-hoverable-height;
  211. top: 0;
  212. z-index: 77;
  213. cursor: default;
  214. user-select: none !important;
  215. touch-action: none !important;
  216. box-sizing: border-box;
  217. padding: 0;
  218. margin: 0;
  219. }
  220. }
  221. if t33 == 0 {
  222.  
  223. ytd-watch-flexy.style-scope[is-two-columns_]:not([fullscreen]):not([theater]) {
  224.  
  225. #columns.style-scope.ytd-watch-flexy,
  226. #primary.style-scope.ytd-watch-flexy,
  227. #primary-inner.style-scope.ytd-watch-flexy,
  228. #secondary.style-scope.ytd-watch-flexy,
  229. #secondary-inner.style-scope.ytd-watch-flexy {
  230. height: 100vh;
  231. max-height: 100%;
  232. }
  233. }
  234.  
  235. ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) {
  236.  
  237. height: 100vh;
  238. #player-theater-container.ytd-watch-flexy {
  239. flex: 77;
  240. max-height: unset;
  241. }
  242.  
  243.  
  244. }
  245.  
  246.  
  247.  
  248. &:not([tabview-loaded]) ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) {
  249.  
  250.  
  251. #player-theater-container.ytd-watch-flexy ~ #columns.style-scope.ytd-watch-flexy {
  252. overflow: visible;
  253. }
  254. }
  255.  
  256. }
  257.  
  258. } //
  259. #microformat.ytd-watch-flexy {
  260. position: fixed;
  261. top:-200vh;
  262. left:-200vw;
  263. }
  264. contentSingleColMobile(){
  265.  
  266. // html:has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]))
  267.  
  268. if no-masthead-w>=1 {
  269.  
  270.  
  271. if youtube-wpr {
  272.  
  273.  
  274. &[youtube-wpr*="h2"] ytd-watch-flexy:not([theater]):not([fullscreen]):not([no-top-margin]):not([reduced-top-margin]) .ytd-watch-flexy{buildL4('is', '#primary', '#secondary')} {
  275. padding-top: 0px;
  276. }
  277. &[youtube-wpr*="h2"] ytd-watch-flexy[tyt-tab^="#tab-"]:not([is-two-columns_]) #primary-inner.ytd-watch-flexy {
  278. padding-bottom: 0px;
  279. }
  280.  
  281.  
  282.  
  283. } else {
  284.  
  285.  
  286. &:has(#chat:not([collapsed])) ytd-watch-flexy:not([theater]):not([fullscreen]):not([no-top-margin]):not([reduced-top-margin]) .ytd-watch-flexy{buildL4('is', '#primary', '#secondary')} {
  287. padding-top: 0px;
  288. }
  289. &:has(#chat:not([collapsed])) ytd-watch-flexy[tyt-tab^="#tab-"]:not([is-two-columns_]) #primary-inner.ytd-watch-flexy {
  290. padding-bottom: 0px;
  291. }
  292.  
  293. }
  294.  
  295. }
  296.  
  297. #chat:not([collapsed]) {
  298. --ytd-margin-2x: 0;
  299. --ytd-margin-4x: 0;
  300. --ytd-margin-6x: 0;
  301. --ytd-margin-8x: 0;
  302.  
  303. height: 100% !important;
  304. min-height: unset !important;
  305. max-height: 100vh !important;
  306.  
  307. // position:relative;
  308. // top:auto;
  309. // bottom:0;
  310.  
  311. iframe#chatframe{
  312.  
  313.  
  314. min-height: 0px;
  315.  
  316. }
  317.  
  318.  
  319.  
  320. if chat-zoom-for-mobile-enable {
  321.  
  322.  
  323. iframe-transform = 'scale(%s)' % chat-zoom-for-mobile
  324. iframe-ratio = 100% / chat-zoom-for-mobile
  325.  
  326. iframe#chatframe {
  327. position:absolute;
  328.  
  329. transform: iframe-transform;
  330. height: s('calc((100% - %s) / %s) !important', chat-btn-height, chat-zoom-for-mobile);
  331. max-height: unset !important;
  332. min-height: unset !important;
  333. transform-origin: 0 0;
  334. width: iframe-ratio !important;
  335. margin-top: chat-btn-height;
  336.  
  337.  
  338. }
  339.  
  340.  
  341. }
  342.  
  343.  
  344. }
  345.  
  346.  
  347. m = youtube-wpr ? '[youtube-wpr*="h2"]': ":has(#chat:not([collapsed]))"
  348.  
  349. &{selector(m)} {
  350. // html:has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen])):has(#chat:not([collapsed]))
  351.  
  352. #contentContainer.tp-yt-app-drawer[swipe-open].tp-yt-app-drawer::after {
  353.  
  354. content: unset;
  355.  
  356. }
  357.  
  358.  
  359. if t33 == 0 {
  360.  
  361. #primary-inner.ytd-watch-flexy ytd-comments#comments.ytd-watch-flexy,
  362. #below.ytd-watch-flexy > .ytd-watch-flexy{buildL4('is', '#related', 'ytd-watch-metadata')} {
  363. /* display:none !important; */
  364. position: fixed !important;
  365. transform: scale(0.01) !important;
  366. transform-origin: 0 0 !important;
  367. left: -100vw !important;
  368. top: -100vh !important;
  369. visibility: collaspe !important;
  370. pointer-events: none !important;
  371. user-select: none !important;
  372. touch-action: none !important;
  373. }
  374.  
  375. }
  376.  
  377. #secondary.ytd-watch-flexy {
  378. display:none !important;
  379. }
  380.  
  381.  
  382.  
  383.  
  384. .efyt-control-bar {
  385. position: relative;
  386. display: inline-flex;
  387. top: auto;
  388. left: auto;
  389. z-index: 99999;
  390. opacity: 0.8;
  391. transform: translate(calc(-100% + 32px), 0) !important;
  392. }
  393.  
  394. .efyt-control-bar:hover {
  395. opacity: 1.0;
  396. background: var(--yt-spec-general-background-a);
  397. transform: translate(0px, 0) !important;
  398. }
  399.  
  400. #player {
  401. margin-bottom: 0;
  402. }
  403.  
  404.  
  405.  
  406. {buildL4('is', '#columns', '#primary')} {
  407. padding: 0;
  408. }
  409.  
  410. --ylb-min-below-area: chat-min-height;
  411.  
  412.  
  413.  
  414.  
  415. {buildL4('is', '#player', '#player-theater-container', '#player-container-outer', '#player-container-inner', '#player-container', '#movie_player', '#movie_player video')} {
  416. object-fit: contain;
  417. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  418.  
  419. }
  420.  
  421.  
  422. if t33 == 0 {
  423.  
  424. #primary-inner.ytd-watch-flexy > :not(.style-scope) {
  425. display: none !important;
  426. }
  427.  
  428. #below > *:not(#chat) {
  429. /* display:none !important; */
  430. position: fixed !important;
  431. transform: scale(0.01) !important;
  432. transform-origin: 0 0 !important;
  433. left: -100vw !important;
  434. top: -100vh !important;
  435. visibility: collaspe !important;
  436. pointer-events: none !important;
  437. user-select: none !important;
  438. touch-action: none !important;
  439.  
  440. }
  441. }
  442.  
  443. #below:not(:has(#chat)) {
  444. display: none;
  445. }
  446.  
  447.  
  448.  
  449. {buildL4('is', 'ytd-watch-flexy', '#columns.ytd-watch-flexy', '#primary.ytd-watch-flexy', '#primary-inner.ytd-watch-flexy')} {
  450. display: flex;
  451. flex-direction: column;
  452. margin: 0;
  453. flex: 1;
  454. }
  455.  
  456. #below {
  457. flex: 1;
  458. }
  459.  
  460. ytd-watch-flexy {
  461. height: 100vh !important;
  462. max-height: 100vh !important;
  463. }
  464.  
  465. ytd-watch-flexy{buildL4('is', '[theater]', '[fullscreen]')} #player-theater-container.ytd-watch-flexy {
  466.  
  467. min-height: unset !important;
  468. }
  469. }
  470.  
  471.  
  472. }
  473.  
  474. content2c() {
  475.  
  476. if t33 == 0 {
  477. if chat-zoom-for-right-col >1 or chat-zoom-for-right-col < 1 {
  478.  
  479. ytd-watch-flexy[is-two-columns_]:not([fullscreen]) iframe#chatframe {
  480.  
  481. position:absolute;
  482. margin-top:chat-btn-height;
  483.  
  484. transform: 'scale(%s)' % chat-zoom-for-right-col;
  485. transform-origin: 0 0;
  486. width: '%s !important' % (100% / chat-zoom-for-right-col);
  487. max-width: unset !important;
  488. height: s('calc( (100% - %s) / %s ) !important', chat-btn-height, chat-zoom-for-right-col);
  489. z-index: 1; /* for normal youtube */
  490.  
  491. }
  492.  
  493. }
  494.  
  495.  
  496. if no-masthead-w==0 {
  497.  
  498. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) {
  499.  
  500. .style-scope.ytd-watch-flexy{buildL4('is', '#secondary', '#secondary-inner')} {
  501. height: calc(100vh - var(--ytd-toolbar-height));
  502. max-height: 100%;
  503. }
  504. }
  505. }
  506.  
  507.  
  508. ytd-watch-flexy[is-two-columns_]:not([fullscreen]) #movie_player {
  509.  
  510. .ytp-chrome-bottom[style*="width"] {
  511. width: unset !important;
  512. left: chrome-bottom-bar-margin !important;
  513. right: chrome-bottom-bar-margin !important;
  514. }
  515.  
  516. }
  517.  
  518.  
  519. /*
  520.  
  521. // originally this is to avoid sizing issue; however, as userscript "YouTube Video Resize Fix" is a must, this is no longer required.
  522. // this css rule not compatible with YouTubeLiveClock
  523.  
  524. ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]) #movie_player {
  525.  
  526. .ytp-chrome-bottom[style*="width"] {
  527. left: 50% !important;
  528. transform: translateX(-50%);
  529. }
  530.  
  531. }
  532.  
  533. */
  534.  
  535.  
  536. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) ytd-live-chat-frame#chat:not([collapsed]) {
  537. min-height: unset;
  538. }
  539.  
  540.  
  541.  
  542. ytd-watch-flexy.style-scope[is-two-columns_]:not([fullscreen]) #primary-inner.ytd-watch-flexy > *:not(#player) {
  543. padding: 0 primary-content-margin 0;
  544. }
  545.  
  546.  
  547. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) #player .ytd-watch-flexy{buildL4('is', '#player-container-outer', '#player-container-inner', '#player-container')}{
  548.  
  549. // layout outside
  550. // no effect
  551. // layout inside
  552. max-height: calc(100vh - var(--ytd-toolbar-height, 0px) - var(--ylb-min-below-area, 0px)); // for very wide screen
  553. }
  554.  
  555. ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) #player-theater-container.ytd-watch-flexy {
  556. max-height: calc(100vh - var(--ytd-toolbar-height, 0px) - var(--ylb-min-below-area, 0px)); // for 4:3 video
  557.  
  558. }
  559.  
  560.  
  561. body.lock-scrollbar {
  562. overflow-y: auto;
  563. }
  564. /*
  565. body.lock-scrollbar[style*="overflow"][style*="hidden"]:has(ytd-watch-flexy[is-two-columns_]:not([hidden])):has(#movie_player) {
  566. overflow-y: unset !important;
  567. }
  568. */
  569.  
  570.  
  571. ytd-watch-flexy.style-scope[is-two-columns_] #columns.ytd-watch-flexy > #secondary.ytd-watch-flexy {
  572. width: side-panel-width;
  573. }
  574.  
  575. }
  576.  
  577.  
  578. }
  579.  
  580. contentf() {
  581. // html
  582. if t33 == 0 {
  583.  
  584. if (video-padding-left-right + video-padding-top-bottom) > 0 {
  585.  
  586. #player-container-outer.ytd-watch-flexy {
  587. padding-left: video-padding-left-right;
  588. padding-right: video-padding-left-right;
  589. padding-top: video-padding-top-bottom;
  590. padding-bottom: video-padding-top-bottom;
  591. }
  592.  
  593. }
  594.  
  595.  
  596. body ytd-watch-flexy[flexy] #player-container-outer.ytd-watch-flexy {
  597. max-width: unset; // override var(--ytd-watch-flexy-max-player-width);
  598. }
  599.  
  600. &:not([tabview-loaded]) {
  601.  
  602. body ytd-watch-flexy[flexy][is-two-columns_]{buildL4('is', '[is-extra-wide-video_]', '[is-four-three-to-sixteen-nine-video_]')} #primary.ytd-watch-flexy {
  603.  
  604. max-width: unset; // override var(--ytd-watch-flexy-max-player-width);
  605.  
  606. }
  607.  
  608.  
  609. ytd-watch-flexy:not([fullscreen]) #player-theater-container {
  610. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  611. }
  612.  
  613.  
  614. ytd-watch-flexy[is-two-columns_]:not([theater]):not([fullscreen]) {buildL4('is', '#columns', '#primary', '#primary-inner', '#secondary', '#secondary-inner')} {
  615. height: calc(100vh - var(--ytd-toolbar-height));
  616. }
  617.  
  618. }
  619.  
  620. if video-enlarging > 0 {
  621.  
  622. ytd-watch-flexy:not([theater]):not([fullscreen]) #movie_player video[src] {
  623. transform: 'scale(%s)' % (video-enlarging / 1000 + 1) ;
  624. transform-origin: 50% 50%;
  625. }
  626.  
  627. }
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635. ytd-watch-flexy[flexy][is-two-columns_][theater]:not([fullscreen]) {
  636.  
  637. --ylb-min-below-area: min-below-area-for-theater;
  638.  
  639.  
  640. {buildL4('is', '#player', '#player-theater-container', '#player-container-outer', '#player-container-inner', '#player-container', '#movie_player', '#movie_player video')} {
  641. object-fit: contain;
  642. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  643. }
  644. }
  645.  
  646.  
  647.  
  648. if no-bottom-row {
  649.  
  650. #bottom-row.ytd-watch-metadata {
  651. display: none !important;
  652. }
  653. }
  654.  
  655. h1.ytd-watch-metadata {
  656. font-size: video-title-size;
  657. --font-size: video-title-size;
  658. line-height: 140%;
  659. margin-bottom: -2px;
  660. }
  661.  
  662.  
  663. ytd-watch-flexy.style-scope:not([fullscreen]) {
  664.  
  665. & {
  666. --ytd-margin-2y: var(--ytd-margin-2x);
  667. --ytd-margin-4y: var(--ytd-margin-4x);
  668. --ytd-margin-6y: var(--ytd-margin-6x);
  669. --ytd-margin-8y: var(--ytd-margin-8x);
  670. }
  671.  
  672. #columns.style-scope.ytd-watch-flexy {
  673. --ytd-margin-2x: 0;
  674. --ytd-margin-4x: 0;
  675. --ytd-margin-6x: 0;
  676. --ytd-margin-8x: 0;
  677. }
  678.  
  679. .style-scope.ytd-watch-flexy > :not(.ytd-watch-flexy),
  680. #below,
  681. #player {
  682. --ytd-margin-2x: var(--ytd-margin-2y);
  683. --ytd-margin-4x: var(--ytd-margin-4y);
  684. --ytd-margin-6x: var(--ytd-margin-6y);
  685. --ytd-margin-8x: var(--ytd-margin-8y);
  686. }
  687.  
  688. #secondary-inner.style-scope.ytd-watch-flexy {
  689. display: flex;
  690. flex-direction: column;
  691. height: 100%;
  692. }
  693.  
  694. #movie_player {
  695. position: relative;
  696. > .html5-video-container:has(video) {
  697. top: 0;
  698. bottom: 0;
  699. left: 0;
  700. right: 0;
  701. position: absolute;
  702. }
  703.  
  704. .html5-video-container > video {
  705. width: unset !important;
  706. height: 100% !important;
  707. left: 0 !important;
  708. right: 0 !important;
  709. max-height: 100%;
  710. max-width: 100%;
  711. margin: 0 auto;
  712. }
  713.  
  714. /*
  715. .ytp-iv-video-content {
  716. width: 100% !important;
  717. height: 100% !important;
  718. }
  719. */
  720.  
  721. /*
  722. // this is buggy; eg multiple chapter hover container; can be fixed by YouTube Video Resize Fix Only
  723. .ytp-chapter-hover-container[style*="width"] {
  724. width: 100% !important;
  725. }
  726. */
  727.  
  728. .html5-video-container > video[style*="top:"]:not(video[style*="top: -"]):not(video[style*="top:-"]) {
  729. top: 0 !important;
  730. }
  731.  
  732. }
  733.  
  734.  
  735. #chat:not([collapsed]) {
  736. flex: 77;
  737. }
  738.  
  739. #right-tabs {
  740. display: flex;
  741. margin: 0 !important;
  742. flex: 1;
  743. flex-direction: column;
  744.  
  745. {buildL4('is', '#material-tabs', '.tab-content')} {
  746. outline: 0;
  747. }
  748.  
  749. .tab-content {
  750. flex: 77;
  751. }
  752. }
  753.  
  754. &:not([is-two-columns_]) #primary-inner > *:not(#player) {
  755. padding: 0;
  756. }
  757.  
  758. &:not([is-two-columns_]) #primary-inner #below > *:not(ytd-live-chat-frame#chat) {
  759. padding: 0 primary-content-margin 0;
  760. }
  761.  
  762. /*
  763. #player-container-outer.ytd-watch-flexy {
  764. max-width: unset;
  765. }
  766. */
  767. }
  768.  
  769. }
  770.  
  771.  
  772.  
  773. if no-round-border {
  774.  
  775. ytd-live-chat-frame[rounded-container],
  776. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame,
  777. ytd-live-chat-frame[rounded-container] iframe.ytd-live-chat-frame,
  778. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame button.yt-spec-button-shape-next,
  779. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame button.yt-spec-button-shape-next:hover {
  780. border-radius: unset;
  781. }
  782. }
  783.  
  784.  
  785. if disable-cinematics {
  786. #cinematics.ytd-watch-flexy {
  787. display: none;
  788. }
  789. }
  790. } //
  791. contentg() {
  792.  
  793. content2c() //
  794. selector-g = '' //
  795. if mode-for-single-col=="disabled" { //
  796. selector-g = youtube-wpr ? '[youtube-wpr*="s"]': ":has(ytd-watch-flexy[is-two-columns_])" //
  797. } //
  798. &{s(selector-g)} { //
  799. // html
  800. contentf() //
  801. } //
  802. }
  803. content361() //
  804. selectors-2col = { //
  805. "expanded-panel": join(', ',
  806. "html:not([tabview-loaded]):has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)",
  807. "html[tabview-loaded]:has(ytd-watch-flexy[is-two-columns_]:not([fullscreen]))"
  808. ),
  809. "expanded-live": "html:has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)",
  810. "expandable-live": "html:has(ytd-live-chat-frame#chat):has(iframe#chatframe)",
  811. "always": "html"
  812. } //
  813. if youtube-wpr {
  814. selectors-2col = { //
  815. "expanded-panel": join(', ',
  816. 'html:not([tabview-loaded])[youtube-wpr*="h2"][youtube-wpr*="f"]',
  817. 'html[tabview-loaded][youtube-wpr*="s"][youtube-wpr*="f"]'
  818. ),
  819. "expanded-live": 'html[youtube-wpr*="h2"][youtube-wpr*="f"]',
  820. "expandable-live": 'html:not([youtube-wpr*="h0"])[youtube-wpr*="f"]',
  821. "always": 'html[youtube-wpr*="f"]'
  822. } //
  823. }
  824. selector-2col = selectors-2col[mode-for-two-col]
  825. selectors-k = split(', ', selector-2col)
  826. for selector-k in selectors-k {
  827. {s(selector-k)} {
  828. if no-masthead-w==1 {
  829. contentNoMasthead()
  830. }
  831. contentg() //
  832. }
  833. }
  834.  
  835. if single-col-mobile {
  836. m = youtube-wpr ? '[youtube-wpr*="S"][youtube-wpr*="f"]': ":has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]))"
  837. html{selector(m)} {
  838.  
  839. if no-masthead-w>=1 {
  840. contentNoMasthead()
  841. }
  842. contentSingleColMobile()
  843. }
  844. }
  845. @css {
  846.  
  847. @supports not selector(:has(body)) {
  848. html::after {
  849. display: block;
  850. content: 'Your browser does not support "has-selector". Please update to latest version and enable it via configuration.';
  851. width: 60vh;
  852. padding: 12px;
  853. height: auto;
  854. position: fixed;
  855. left: 50%;
  856. top: 50%;
  857. transform: translate(-50%, -50%);
  858. transform-origin: 0 0;
  859. background: #71210f;
  860. color: #d2dadb;
  861. font-size: 14pt;
  862. text-shadow: 1px 1px 2px #605262;
  863. }
  864. }
  865. }
  866.  
  867.  
  868.  
  869. if youtube-wpr {
  870.  
  871.  
  872. @css {
  873. @supports selector(:has(body)) {
  874.  
  875. @keyframes wpr-message-appear {
  876. 0% {
  877. top: -300vh;
  878. }
  879. 1% {
  880. top: 50%;
  881. }
  882. 100% {
  883. top: 50%;
  884. }
  885. }
  886. html:not([youtube-wpr])::after {
  887. display: block;
  888. content: 'YouTube Live Borderless: YouTube WPR is not yet installed. Please install the userscript https://greasyfork.org/scripts/457319 in order to use YouTube WPR';
  889. width: 60vh;
  890. padding: 12px;
  891. height: auto;
  892. position: fixed;
  893. left: 50%;
  894. top: -300vh;
  895. transform: translate(-50%, -50%);
  896. transform-origin: 0 0;
  897. background: #71210f;
  898. color: #d2dadb;
  899. font-size: 14pt;
  900. text-shadow: 1px 1px 2px #605262;
  901. animation: wpr-message-appear 1ms 2s forwards;
  902. }
  903. }
  904.  
  905. }
  906.  
  907. }
  908. }