Reddit Colored Comments [Updated for RES Users]

Customizable Colored Comments for Reddit. [Updated for ReS Users 2025]

当前为 2025-01-20 提交的版本,查看 最新版本

  1. /* ==UserStyle==
  2. @name Reddit Colored Comments [Updated for RES Users]
  3. @namespace typpi.online
  4. @description Customizable Colored Comments for Reddit. [Updated for ReS Users 2025]
  5. @author Nick2bad4u
  6. @version 1.2.6
  7. @license MIT
  8. @preprocessor stylus
  9.  
  10. @var range lineWidth 'Line width' [2, 1, 8, 1]
  11. @var checkbox lineStyle 'Line color style: full or partial' 0
  12. @var checkbox hideLines 'Hide previous lines' 0
  13.  
  14. @var range oldLineWidth 'Old design line width' [2, 1, 8, 1]
  15. @var checkbox oldLineStyle 'Old design line border style: solid or dotted' 0
  16.  
  17. @var color color1 'Level 1 color' #f07178
  18. @var color color2 'Level 2 color' #f78c6c
  19. @var color color3 'Level 3 color' #ffcb6b
  20. @var color color4 'Level 4 color' #f3ff89
  21. @var color color5 'Level 5 color' #c3e88d
  22. @var color color6 'Level 6 color' #8de89e
  23. @var color color7 'Level 7 color' #89ddff
  24. @var color color8 'Level 8 color' #82aaff
  25. @var color color9 'Level 9 color' #c792ea
  26. @var color color10 'Level 10 color' #9a91ea
  27. @var color color11 'Level 11 color' #ffb6c1
  28. @var color color12 'Level 12 color' #ffcccb
  29. @var color color13 'Level 13 color' #ffe4e1
  30. @var color color14 'Level 14 color' #f0e68c
  31. @var color color15 'Level 15 color' #e0ffff
  32. @var color color16 'Level 16 color' #d8bfd8
  33. @var color color17 'Level 17 color' #e6e6fa
  34. @var color color18 'Level 18 color' #f5f5dc
  35. @var color color19 'Level 19 color' #ffffe0
  36. @var color color20 'Level 20 color' #f8f8ff
  37.  
  38. ==/UserStyle== */
  39. @-moz-document domain('reddit.com')
  40. {
  41. t = transparent;
  42. i = !important; // Set line width for the new design
  43. if lineWidth != 2
  44. {
  45. .threadline
  46. {
  47. border-right-width: s('%spx', lineWidth) i;
  48. }
  49. } // Set mode for line style in the new design
  50. $mode = '';
  51. if lineStyle
  52. {
  53. $mode = '> div >';
  54. }
  55.  
  56. for $i in 1..20
  57. {
  58. div[id ^= 't'] > :first-child,
  59. div[id ^= 'moreComments'] > :first-child,
  60. div[id ^= 'continueThread'] > :first-child
  61. {
  62. $nth = s('%s', $i); // Set line colors
  63. > :nth-child({$nth})
  64. {
  65. $mode
  66. }
  67.  
  68. .threadline
  69. {
  70. border-right-color: color + $i i;
  71. } // Hide previous lines
  72. if hideLines
  73. {
  74. > :nth-child({$nth}) > .threadline
  75. {
  76. border-right-color: t i;
  77. }
  78. }
  79. }
  80. } // Old design specific styles
  81. .comment .child,
  82. .comment .showreplies,
  83. .res-commentBoxes.res-continuity .comment div.child
  84. {
  85. // Set line width
  86. if oldLineWidth != 1
  87. {
  88. border-left-width: s('%spx', oldLineWidth) i;
  89. } // Set line style
  90. if oldLineStyle == 0
  91. {
  92. border-left-style: solid i;
  93. }
  94.  
  95. else
  96. {
  97. border-left-style: dotted i;
  98. }
  99. }
  100.  
  101. $str = '.res-commentBoxes.res-continuity .comment div.child ';
  102. for $i in 1..20 {
  103. { $str } {
  104. border-left-color: color + $i i;
  105. }
  106.  
  107. $str += '> .sitetable > .comment > .child ';
  108. }
  109.  
  110. $str2 = '.res-commentBoxes.res-continuity .comment div.child ';
  111. for $i in 1..20 {
  112. { $str2 } .expand:hover {
  113. background-color: color + $i i;
  114. }
  115.  
  116. $str2 += '> .sitetable > .comment > .child ';
  117. }
  118. .commentarea .entry > .tagline > .expand
  119. {
  120. background-color: #00000080;
  121. }
  122. }