Tabview Youtube Design Customization

Change some designs in Tabview Youtube

  1. /* ==UserStyle==
  2. @name Tabview Youtube Design Customization
  3. @version 0.2.6
  4. @namespace github.com/cyfung1031
  5. @license MIT
  6. @description Change some designs in Tabview Youtube
  7. @author CY Fung
  8. @supportURL https://github.com/cyfung1031/Tabview-Youtube/
  9. @preprocessor stylus
  10. @var select default-tab "Default Tab" {
  11. "dt0:Default / Local Setting": "0",
  12. "dt1:Info Tab": "1",
  13. "dt2:Comments Tab": "2",
  14. "dt3:Videos Tab": "3"
  15. }
  16. @var checkbox no-rounded-button "No Rounded Button" 0
  17. @var checkbox no-tab-btn-text "No Tab Button Text" 0
  18. @var checkbox round-tab-container "Round Tab Container" 0
  19. @var checkbox round-live-chat-frame "Round Live Chat Frame" 0
  20. @var checkbox use-custom-rounding "Use Custom Rounding" 0
  21. @var range custom-rounding-value "Custom Rounding Value" [12, 1, 50, 1, 'px']
  22. @var checkbox split-tabs "Split Tabs" 0
  23. @var checkbox hide-tab-info "Hide Tab - Info" 0
  24. @var checkbox hide-tab-comments "Hide Tab - Comments" 0
  25. @var checkbox hide-tab-videos "Hide Tab - Videos" 0
  26. @var checkbox no-red-line-for-single-tab "No Red Line For Single Tab" 0
  27. @var checkbox move-tabs-to-top-side-when-chat-expanded "Move Tabs To Top Side When Chat Expanded" 0
  28. @var checkbox hide-disabled-comment-tab "Hide Disabled Comment Tab" 0
  29. ==/UserStyle== */
  30.  
  31. keyFrameForTabviewTabsHideController(a, x)
  32. $keyframe-name = s('%s-%s',a, x);
  33. @keyframes {$keyframe-name}
  34. for i in 0..1
  35. {100% * i}
  36. background-position-x (i+1)px
  37.  
  38.  
  39. @-moz-document url-prefix("https://www.youtube.com/watch?v=") {
  40.  
  41. if no-rounded-button {
  42. html .yt-spec-button-shape-next--size-m,
  43. html .yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--segmented-start,
  44. // html .yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--icon-button.yt-spec-button-shape-next--segmented-end,
  45. html .yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--segmented-end {
  46. border-radius: 0;
  47. }
  48. }
  49.  
  50. if no-tab-btn-text {
  51. .tab-btn[tyt-tab-content="#tab-info"] span,
  52. .tab-btn[tyt-tab-content="#tab-videos"] span,
  53. .tab-btn[tyt-tab-content="#tab-playlist"] span {
  54. display: none;
  55. }
  56. }
  57. if round-tab-container {
  58. html body ytd-watch-flexy[class] #right-tabs {
  59. border-radius: var(--tyt-rounding-value);
  60. outline: 1px solid var(--yt-spec-10-percent-layer);
  61. contain: paint;
  62. #material-tabs {
  63. border: 0;
  64. }
  65. .tab-content {
  66. border: 0;
  67. border-top: 1px solid var(--yt-spec-10-percent-layer);
  68. }
  69. }
  70. }
  71. if round-live-chat-frame {
  72. ytd-live-chat-frame#chat.ytd-watch-flexy{
  73. border-radius: var(--tyt-rounding-value);
  74. }
  75. }
  76.  
  77. :root {
  78. if use-custom-rounding {
  79. --tyt-rounding-value: custom-rounding-value;
  80. } else {
  81. --tyt-rounding-value: 12px;
  82. }
  83. }
  84. if split-tabs {
  85. html body ytd-watch-flexy #right-tabs {
  86. .tab-btn:nth-child(n+2)::before {
  87. content: "";
  88. background: var(--yt-spec-10-percent-layer);
  89. position: absolute;
  90. left: 0;
  91. top: 8px;
  92. height: 30px;
  93. width: 1px;
  94. }
  95. }
  96. }
  97. tyt-tabs-hide-config = 0
  98. if hide-tab-info + hide-tab-comments + hide-tab-videos < 3 {
  99.  
  100. tki = 0
  101. if hide-tab-info {
  102. tyt-tabs-hide-config += 1
  103. tki += 1
  104. }
  105. if hide-tab-comments {
  106. tyt-tabs-hide-config += 2
  107. tki += 1
  108. }
  109. if hide-tab-videos {
  110. tyt-tabs-hide-config += 4
  111. tki += 1
  112. }
  113.  
  114. if tki == 2 && no-red-line-for-single-tab {
  115. body ytd-watch-flexy #right-tabs .tab-btn[tyt-tab-content].active {
  116. border-bottom-color: transparent;
  117. }
  118. }
  119. }
  120.  
  121. controllerId = unquote('tabviewTabsHideController')
  122. keyFrameForTabviewTabsHideController(controllerId, tyt-tabs-hide-config)
  123.  
  124. #tabview-tabs-hide-controller{
  125. animation: s('%s-%s 0ms linear 0ms 1 normal forwards', controllerId, tyt-tabs-hide-config);
  126. }
  127. tyt-default-tab-config = default-tab - 0;
  128. controllerId = unquote('tabviewDefaultTabController')
  129. keyFrameForTabviewTabsHideController(controllerId, tyt-default-tab-config)
  130.  
  131. #tabview-default-tab-controller{
  132. animation: s('%s-%s 0ms linear 0ms 1 normal forwards', controllerId, tyt-default-tab-config);
  133. }
  134. if move-tabs-to-top-side-when-chat-expanded {
  135.  
  136. ytd-watch-flexy[tyt-chat^="+"] #secondary-inner.style-scope.ytd-watch-flexy {
  137. display:flex;
  138. flex-direction: column;
  139. }
  140.  
  141. ytd-watch-flexy[tyt-chat^="+"] #chat-container, ytd-watch-flexy[tyt-chat^="+"] ytd-live-chat-frame#chat {
  142. order: 99;
  143. }
  144.  
  145. ytd-watch-flexy[is-two-columns_][tyt-chat][tyt-chat^="+"] #secondary-inner.style-scope.ytd-watch-flexy #right-tabs {
  146. --tyt-right-tabs-margin-top: 0;
  147. --tyt-right-tabs-margin-bottom: var(--tyt-right-tabs-margin-size);
  148. }
  149.  
  150. }
  151. if hide-disabled-comment-tab {
  152. .tab-btn[loaded-comment="message"] {
  153. display: none !important;
  154. }
  155. }
  156. }