YouTube Chat Bubbles

Make YouTube Chat Bubbles

  1. /* ==UserStyle==
  2. @name YouTube Chat Bubbles
  3. @version 0.1.5
  4. @namespace github.com/cyfung1031
  5. @license MIT
  6. @description Make YouTube Chat Bubbles
  7. @author CY Fung
  8. @preprocessor stylus
  9. @var color color-bubble-text "Bubble Text Color" #000
  10. @var color color-bubble-background "Bubble Background Color" #bccbbc
  11. @var checkbox bubble-shift "Bubble Shift" 1
  12. @var range bubble-shift-px "Bubble Shift px (10: 0px)" [8, 1, 20]
  13. ==/UserStyle== */
  14.  
  15.  
  16. @-moz-document url-prefix("https://www.youtube.com/live_chat") {
  17. #items yt-live-chat-text-message-renderer{ // weak selector
  18. contain: layout style;
  19. }
  20. bubble-shift-px = bubble-shift-px - 10
  21.  
  22. #items.style-scope.yt-live-chat-item-list-renderer {
  23.  
  24. #message.yt-live-chat-text-message-renderer {
  25. padding: 3px 10px !important;
  26. if bubble-shift {
  27. margin-left: '%s !important' % (bubble-shift-px * 1px);
  28. }
  29. background: color-bubble-background;
  30. border-radius: 12px;
  31. color: color-bubble-text;
  32. display: flex !important;
  33. max-width: max-content;
  34. flex-wrap: wrap;
  35. align-items: center;
  36. min-height: 2.6rem;
  37. }
  38.  
  39. #message.yt-live-chat-text-message-renderer a {
  40. color: inherit !important;
  41. }
  42.  
  43. #message.yt-live-chat-text-message-renderer::before {
  44. content: '';
  45. --egl-btn-half-border-size: 7px;
  46. --egl-btn-color: color-bubble-background;
  47. display: block;
  48. position: absolute;
  49. border-top: 0;
  50. border-right: 7px inset transparent;
  51. border-bottom: 10px solid var(--egl-btn-color);
  52. border-left: 10px inset transparent;
  53. transform: rotate(46deg);
  54. margin-left: -18px;
  55. margin-top: -8px;
  56. transform-origin: center center;
  57. pointer-events: none;
  58. touch-action: none;
  59. user-select: none;
  60. }
  61.  
  62.  
  63. yt-live-chat-author-chip {
  64. margin-top: 4px;
  65. margin-bottom: 2px;
  66. }
  67.  
  68. #author-photo {
  69. align-self: center;
  70. display: flex;
  71. }
  72. }
  73. }

QingJ © 2025

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