YouTube Buttons for Chat Filter

Turn drop down buttons to normal buttons

  1. /* ==UserStyle==
  2. @name YouTube Buttons for Chat Filter
  3. @namespace github.com/cyfung1031
  4. @version 0.1.5
  5. @description Turn drop down buttons to normal buttons
  6. @author CY Fung
  7. @license MIT
  8. @preprocessor stylus
  9. @var range offset-k "Proportional Offset" [10, 2, 20, 2, 'vw']
  10. @var range offset-c "Constant Offset" [20, 4, 40, 4, 'px']
  11. @var range offset-m "Min Offset" [64, 4, 128, 4, 'px']
  12. @var range btn-h-ratio "Button Height Ratio" [1, 0.2, 1.0, 0.1]
  13. @var range btn-w-ratio "Button Width Ratio" [1, 0.2, 1.0, 0.1]
  14. @var range btn-gap "Button Gap" [0, 0, 8, 2, 'px']
  15. ==/UserStyle== */
  16. @-moz-document url-prefix("https://www.youtube.com/live_chat") {
  17. dummy(){
  18. // dummy
  19. border: 0;
  20. }
  21. css-right = s('max(calc( %s + %s ), %s)', offset-c, offset-k, offset-m)
  22. yt-dropdown-menu.yt-sort-filter-sub-menu-renderer {
  23. #trigger, tp-yt-paper-button {
  24. pointer-events: none !important;
  25. user-select: none !important;
  26. touch-action: none !important;
  27. #label-icon {
  28. display:none;
  29. }
  30. #label-text {
  31. max-width: calc(100vw - 160px);
  32. }
  33. }
  34. tp-yt-iron-dropdown#dropdown {
  35. display: block !important;
  36. position: fixed;
  37. width: 0;
  38. height: 0;
  39. padding: 0;
  40. margin: 0;
  41. contain: size style;
  42. }
  43.  
  44. div#contentWrapper {
  45. padding: 0;
  46. margin: 0;
  47. contain: size style;
  48. }
  49.  
  50. .dropdown-content.style-scope.tp-yt-paper-menu-button {
  51. padding: 0;
  52. margin: 0;
  53. max-height: unset;
  54. max-width: unset;
  55. position: fixed;
  56. right: css-right;
  57. border-radius: 0;
  58. transform: s('scale(%s, %s)', 100% * btn-w-ratio, 100% * btn-h-ratio);
  59. contain: paint layout style;
  60. }
  61.  
  62. tp-yt-paper-listbox#menu {
  63. height: auto;
  64. width: 100%;
  65. padding: 0;
  66. border-radius: 0 !important;
  67. display: flex;
  68. flex-direction: row;
  69. flex-wrap: nowrap;
  70. gap: btn-gap;
  71. contain: paint layout style;
  72. }
  73.  
  74. a.yt-simple-endpoint.style-scope.yt-dropdown-menu {
  75. display: inline-flex;
  76. /* position: absolute !important; */
  77. z-index: 1;
  78. width: 32px;
  79. height: 26px;
  80. background-color: var(--yt-live-chat-toast-background-color);
  81. border: 1px solid var(--yt-live-chat-toast-text-color);
  82. padding: 0;
  83. margin: 0;
  84. overflow: hidden;
  85. border-radius: 0;
  86. color: var(--yt-live-chat-toast-text-color);
  87. cursor: pointer;
  88. transition: opacity 300ms, background 300ms;
  89. contain: size paint layout style;
  90. }
  91.  
  92. a.yt-simple-endpoint.style-scope.yt-dropdown-menu::before {
  93. content: '三';
  94. font-family: 'Roboto';
  95. font-size: 1.2rem;
  96. width: 100%;
  97. display: flex;
  98. justify-content: center;
  99. align-items: center;
  100. pointer-events: none !important;
  101. user-select: none !important;
  102. touch-action: none !important;
  103. transform-origin: 50% 50%;
  104. transform: scale(184%, 152%);
  105. -webkit-font-smoothing: initial;
  106. }
  107.  
  108. a.yt-simple-endpoint.style-scope.yt-dropdown-menu > .yt-dropdown-menu {
  109. display: none !important;
  110. }
  111.  
  112. a.yt-simple-endpoint.style-scope.yt-dropdown-menu + a.yt-simple-endpoint.style-scope.yt-dropdown-menu::before {
  113. content: '亖';
  114. }
  115.  
  116. a.yt-simple-endpoint.style-scope.yt-dropdown-menu {
  117. --opacity: 0.5;
  118. opacity: var(--opacity);
  119. }
  120.  
  121. a.yt-simple-endpoint.style-scope.yt-dropdown-menu.iron-selected:not(:hover) {
  122. --opacity: 0.8;
  123. }
  124.  
  125. a.yt-simple-endpoint.style-scope.yt-dropdown-menu:hover {
  126. /* background-color: var(--yt-live-interactivity-component-background-color); */
  127. --opacity: 0.7;
  128. }
  129.  
  130. a.yt-simple-endpoint.style-scope.yt-dropdown-menu.iron-selected:hover {
  131. /* background-color: var(--yt-live-interactivity-component-background-color); */
  132. --opacity: 1.0;
  133. }
  134.  
  135. a.yt-simple-endpoint.style-scope.yt-dropdown-menu[class].iron-selected {
  136. background-color: var(--yt-spec-commerce-tonal-hover);
  137.  
  138. }
  139.  
  140. }
  141. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址