YouTube Live Borderless

Make YouTube Live Borderless

当前为 2023-07-14 提交的版本,查看 最新版本

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