Reddit Colored Comments [Updated for RES Users]

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

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

  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.4
  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. ==/UserStyle== */
  28. @-moz-document domain('reddit.com')
  29. {
  30. t = transparent;
  31. i = !important; // Set line width for the new design
  32. if lineWidth != 2
  33. {
  34. .threadline
  35. {
  36. border-right-width: s('%spx', lineWidth) i;
  37. }
  38. } // Set mode for line style in the new design
  39. $mode = '';
  40. if lineStyle
  41. {
  42. $mode = '> div >';
  43. }
  44.  
  45. for $i in 1..10
  46. {
  47. div[id ^= 't'] > :first-child,
  48. div[id ^= 'moreComments'] > :first-child,
  49. div[id ^= 'continueThread'] > :first-child
  50. {
  51. $nth = s('%s', $i); // Set line colors
  52. > :nth-child({$nth})
  53. {
  54. $mode
  55. }
  56.  
  57. .threadline
  58. {
  59. border-right-color: color + $i i;
  60. } // Hide previous lines
  61. if hideLines
  62. {
  63. > :nth-child({$nth}) > .threadline
  64. {
  65. border-right-color: t i;
  66. }
  67. }
  68. }
  69. } // Old design specific styles
  70. .comment .child,
  71. .comment .showreplies,
  72. .res-commentBoxes.res-continuity .comment div.child
  73. {
  74. // Set line width
  75. if oldLineWidth != 1
  76. {
  77. border-left-width: s('%spx', oldLineWidth) i;
  78. } // Set line style
  79. if oldLineStyle == 0
  80. {
  81. border-left-style: solid i;
  82. }
  83.  
  84. else
  85. {
  86. border-left-style: dotted i;
  87. }
  88. }
  89.  
  90. $str = '.res-commentBoxes.res-continuity .comment div.child ';
  91. for $i in 1..10 {
  92. { $str } {
  93. border-left-color: color + $i i;
  94. }
  95.  
  96. $str += '> .sitetable > .comment > .child ';
  97. }
  98. }