Greasy Fork 还支持 简体中文。

Better StackOverflow

adds outline to code blocks, ad block, no cookie modal.

目前為 2023-05-05 提交的版本,檢視 最新版本

  1. /* ==UserStyle==
  2. @name Better StackOverflow
  3. @description adds outline to code blocks, ad block, no cookie modal.
  4. @author NotYou
  5. @match *://stackoverflow.com/*
  6. @match *://*.stackoverflow.com/*
  7. @match *://stackexchange.com/*
  8. @match *://superuser.com/*
  9. @match *://serverfault.com/*
  10. @match *://askubuntu.com/*
  11. @match *://stackapps.com/*
  12. @match *://mathoverflow.net/*
  13. @namespace -
  14. @version 1.1.0
  15. @license GPL-3.0-or-later
  16. ==/UserStyle== */
  17.  
  18. /* Darked Accepted Mark Background in questions list */
  19. .s-post-summary--stats .s-post-summary--stats-item.has-answers.has-accepted-answer {
  20. background-color: var(--green-600);
  21. border-color: var(--green-600);
  22. }
  23.  
  24. /* Ad Block */
  25. .img_ad,
  26. #dfp-tsb,
  27. #dfp-smlb,
  28. #dfp-tlb,
  29. #dfp-mlb,
  30. .js-report-ad-button-container,
  31. .adsbox,
  32.  
  33. /* Cookie */
  34. .js-consent-banner {
  35. display: none !important;
  36. }
  37.  
  38. .js-tag-editor.tag-editor.multi-line.s-input {
  39. width: 100% !important;
  40. }
  41.  
  42. /* Code Outline */
  43. .default.s-code-block {
  44. --color: rgba(0, 0, 0, .2);
  45. }
  46.  
  47. [class*="lang-"] {
  48. border: 2px solid var(--color);
  49. }
  50.  
  51. [class*="lang-"]::after {
  52. content: '\a'var(--content);
  53. color: var(--color) !important;
  54. padding: 2px 5px 5px 5px;
  55. font-weight: 800;
  56. }
  57.  
  58. .snippet-code [class*="lang-"]::after {
  59. content: '\a\a'var(--content);
  60. }
  61.  
  62. .s-code-block::after {
  63. font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  64. }
  65.  
  66. .lang-none {
  67. --content: "Plain";
  68. --color: rgb(100, 0, 0);
  69. }
  70.  
  71. .lang-js {
  72. --color: rgb(247, 223, 30);
  73. --content: "JS";
  74. }
  75.  
  76. .lang-js::after {
  77. color: rgb(0, 0, 0);
  78. }
  79.  
  80. .lang-html {
  81. --color: rgb(242, 103, 44);
  82. --content: "HTML";
  83. }
  84.  
  85. .lang-css {
  86. --color: rgb(52, 169, 222);
  87. --content: "CSS";
  88. }
  89.  
  90. .lang-java {
  91. --color: rgb(234, 146, 5);
  92. --content: "Java";
  93. }
  94.  
  95. .lang-py,
  96. .lang-python {
  97. --color: rgb(54, 119, 173);
  98. --content: "Python";
  99. }
  100.  
  101. .lang-cpp {
  102. --color: rgb(101, 154, 210);
  103. --content: "C++";
  104. }
  105.  
  106. .lang-cs,
  107. .lang-csharp {
  108. --color: rgb(93, 108, 189);
  109. --content: "C#";
  110. }
  111.  
  112. .lang-c {
  113. --color: rgb(93, 108, 189);
  114. --content: "C";
  115. }
  116.  
  117. .lang-php {
  118. --color: rgb(93, 108, 189);
  119. --content: "PHP";
  120. }
  121.  
  122. .lang-rb {
  123. --color: rgb(174, 21, 5);
  124. --content: "Ruby";
  125. }
  126.  
  127. .lang-r {
  128. --color: rgb(35, 105, 190);
  129. --content: "R";
  130. }
  131.  
  132. .lang-perl {
  133. --color: rgb(66, 68, 109);
  134. --content: "Perl";
  135. }
  136.  
  137. .lang-bsh {
  138. --color: rgb(41, 48, 54);
  139. --content: "Bash";
  140. }
  141.  
  142. .lang-kotlin {
  143. --color: rgb(117, 114, 227);
  144. --content: "Kotlin";
  145. }
  146.  
  147. .lang-rust {
  148. --color: rgb(0, 0, 0);
  149. --content: "Rust";
  150. }
  151.  
  152. .lang-regex {
  153. --color: rgb(64, 209, 178);
  154. --content: "RegEx";
  155. }
  156.  
  157. .lang-sql {
  158. --color: rgb(192, 207, 212);
  159. --content: "SQL";
  160. }
  161.  
  162. .lang-pascal {
  163. --color: rgb(50, 96, 160);
  164. --content: "Pascal";
  165. }
  166.  
  167. .lang-vb {
  168. --color: rgb(60, 110, 179);
  169. --content: "VB";
  170. }
  171.  
  172. .lang-xml {
  173. --color: rgb(0, 95, 174);
  174. --content: "XML";
  175. }
  176.  
  177. .lang-lua {
  178. --color: rgb(0, 0, 128);
  179. --content: "Lua";
  180. }
  181.  
  182. .lang-go {
  183. --color: rgb(106, 215, 228);
  184. --content: "Go";
  185. }
  186.  
  187. .lang-swift {
  188. --color: rgb(250, 42, 31);
  189. --content: "Swift";
  190. }
  191.  
  192. .lang-clj {
  193. --color: rgb(145, 180, 255);
  194. --content: "Clojure";
  195. }
  196.  
  197. .lang-scala {
  198. --color: rgb(234, 2, 0);
  199. --content: "Scala";
  200. }