Better StackOverflow

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

目前为 2023-01-12 提交的版本。查看 最新版本

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