Swap colours of issue status icon at GitHub and Bugzilla. Open=red, closed=green.

Makes "good" icons green and "bad" ones red. Closed issue is good, unresolved is bad.

  1. /* ==UserStyle==
  2. @name Swap colours of issue status icon at GitHub and Bugzilla. Open=red, closed=green.
  3. @description Makes "good" icons green and "bad" ones red. Closed issue is good, unresolved is bad.
  4. @namespace myfonj
  5. @version 0.1.4
  6. @license CC0 - Public Domain
  7. ==/UserStyle== */
  8. @-moz-document domain("bugzilla.mozilla.org") {
  9. /*
  10. https://gf.qytechs.cn/en/scripts/406730/versions/new
  11. https://userstyles.world/style/11232
  12.  
  13. Changelog
  14. 0.1.4 (2024-05-15) fix svg colors for open and closed stuff in search
  15. 0.1.3 (2024-02-29) green badge on closed checkmark in timeline (in comments)
  16. 0.1.2 (2023-07-31) merged badge background (= "OK")
  17. */
  18. /*
  19. <span class="bug-status-label text" data-status="closed">Closed</span>
  20. --bug-status-color-open: #188716;
  21. --bug-status-color-closed: #1B6AB8;
  22. --bug-status-color-untriaged: #1B9BB8;
  23. --bug-type-color-defect: #EA3C3D;
  24. --bug-type-color-enhancement: #2ABA27;
  25. --bug-type-color-task: #2886C9;
  26. */
  27. [class*="bug-status"][data-status="open"] {
  28. --bug-status-color-open: #EA3C3D;
  29. }
  30. [class*="bug-status"][data-status="closed"] {
  31. --bug-status-color-closed: #188716;
  32. }
  33. .bz_bug_link:not(.bz_closed) {
  34. color: color-mix(in srgb, white 30%, red);
  35. }
  36. .bz_bug_link.bz_closed {
  37. color: color-mix(in srgb, white 30%, green);
  38. }
  39.  
  40. }
  41.  
  42.  
  43. @-moz-document domain("github.com") {
  44. /*
  45. GitHub - swap colors (open=red, closed=green)
  46. .State--draft,
  47. .State--open,
  48. .State--merged,
  49. .State--closed,
  50. .State--small
  51. */
  52. path[d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"], /* dot */
  53. path[d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"], /* circle */
  54. .octicon.open,
  55. .octicon.octicon-issue-opened:not(.UnderlineNav-octicon) path
  56. { color: #cb2431; /* original is green */
  57. }
  58. path[d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm1.5 0a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm10.28-1.72-4.5 4.5a.75.75 0 0 1-1.06 0l-2-2a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018l1.47 1.47 3.97-3.97a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"], /* Circle with check */
  59. .octicon.closed,
  60. .octicon.octicon-issue-closed path
  61. { color: #28a745; /* original is red */
  62. }
  63. .reponav-item .octicon path,
  64. .table-list-header-toggle .btn-link path,
  65. .State--green .octicon.octicon-issue-opened path,
  66. .State--red .octicon.octicon-issue-closed path
  67. { color: inherit
  68. }
  69. .State--open,
  70. .State--green
  71. { background-color: #cb243133; /* original is green */
  72. ;color: #cb2431;
  73. }
  74. .State--merged,
  75. .State--closed,
  76. .State--red
  77. { background-color: #28a74533; /* original is red */
  78. ; color: #28a745;
  79. }
  80. /* same, but importat, TBH IDK Y it has to be this way */
  81. .TimelineItem-badge.color-fg-on-emphasis.color-bg-done-emphasis,
  82. .TimelineItem-badge.color-fg-on-emphasis.color-bg-done-emphasis .octicon-issue-closed
  83. { background-color: #28a74533 !important; /* original is violet */
  84. ; color: #28a745 !important;
  85. }
  86.  
  87. .type-icon-state-closed .octicon-git-pull-request
  88. { /* leaving original red, as for "closed not merged" */
  89. }
  90. .octicon.octicon-git-pull-request.open
  91. { color: orange; /* original is green */
  92. }
  93. .octicon.octicon-git-pull-request.open.text-green
  94. { color: orange !important; /* text-green is !important; ghis appears in tooltip */
  95. }
  96. .octicon.octicon-git-merge.merged , /* does not seem to be needed anymore */
  97. .type-icon-state-merged .octicon-git-merge
  98. { color: #28a745; /* original violet seems quite ok-ish as well, but to be consistent let's make it green. merged PR = OK*/
  99. }
  100. .octicon-git-pull-request.closed
  101. { color: #cb2431; /* original is green; closed not merged - not error, not OK */
  102. }
  103. .octicon-git-pull-request.text-gray-light
  104. { /* "draft" PR is gray */
  105. }
  106. /* user closed this issue ... */
  107. .TimelineItem-badge.text-white.bg-red > .octicon.octicon-circle-slash
  108. { background-color: #28a745;
  109. outline: .4rem solid #28a745;
  110. color: rgba(255,255,255,.2); /* icon shape is like "🚫" here */
  111. }
  112. /* user reopened this issue ... */
  113. .TimelineItem-badge.text-white.bg-green > .octicon.octicon-dot-fill
  114. { background-color: #cb2431;
  115. outline: .4rem solid #cb2431;
  116. color: rgba(255,255,255,.2); /* icon shape is "•" here */
  117. }
  118. }
  119. /* Open pull request should not be red. Nor green. */
  120. @-moz-document regExp("https://github.com/[^/]+/[^/]+/pull/.*")
  121. {
  122. #partial-discussion-header .State.State--green { background-color: purple; }
  123. }
  124. /*
  125. END: GitHub - swap colors (open=red, closed=green)
  126. */

QingJ © 2025

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