Google search "old style"

Fix style in google search results page

目前为 2020-08-23 提交的版本。查看 最新版本

  1. /* ==UserStyle==
  2. @name Google search "old style"
  3. @namespace https://github.com/Procyon-b
  4. @version 1.0.10
  5. @description Fix style in google search results page
  6. @author Achernar
  7. @license CC BY-NC 4.0
  8. @preprocessor stylus
  9.  
  10. @var checkbox hide-favicon 'Hide favicons' 1
  11. @var checkbox invert-lines 'Invert lines' 1
  12. @var checkbox font-size 'Reduce results font size' 1
  13. @var range font-sizeV '  size' [0.9, 0.7, 1, 0.01]
  14. @var checkbox get-ws 'Recover whitespace' 0
  15. @var checkbox head-mg '  Title margin' 1
  16. @var range line-h "  Text's line height" [1.57, 1.0, 1.7, .01]
  17. @var range bottom-mg '  Bottom margin' [27, 0, 30, 1, 'px']
  18. ==/UserStyle== */
  19. @-moz-document regexp("^https:\\/\\/www.google\\..*?\\/search\\?.*") {
  20. /* version 20200225.2000 v1.0.9 */
  21.  
  22. /* reduce result blocks font size */
  23. if font-size {
  24. .g {
  25. --font-sizeV: font-sizeV;
  26. --sz-norm: 14px;
  27. --sz-gblk: 16px;
  28. --margin-b: 27px;
  29. /*zoom: 90%;*/
  30. zoom: font-sizeV;
  31. }
  32. /* target firefox as an alternative to "zoom" */
  33. @supports (-moz-appearance: none) {
  34. .g {
  35. font-size: calc(var(--font-sizeV) * var(--sz-norm));
  36. margin-bottom: calc(var(--font-sizeV) * var(--margin-b)) !important;
  37. }
  38. .g.g-blk span > span {
  39. font-size: calc(var(--font-sizeV) * var(--sz-gblk));
  40. }
  41. .g cite {
  42. font-size: calc(var(--font-sizeV) * var(--sz-norm));
  43. }
  44. .g h3 {
  45. font-size: calc(var(--font-sizeV) * 20px) !important;
  46. }
  47. }
  48. }
  49.  
  50. /* hide result favicon */
  51. if hide-favicon {
  52. .g img[height="16"][src*="data:image"][width="16"] {
  53. display: none;
  54. }
  55. }
  56.  
  57. /* invert the 2 lines */
  58. if invert-lines {
  59. .g div.r > a > br:first-child ~ h3 {
  60. display: block;
  61. }
  62. .g div.r > a > br:first-child ~ h3 ~ div {
  63. position: static;
  64. margin-top: -0.2em;
  65. }
  66. .g div.r > a > br:first-child ~ h3 ~ div * {
  67. color: green !important;
  68. }
  69. .g div.r > a > br:first-child {
  70. display: none;
  71. }
  72. .g div.r > a ~ div {
  73. position: static;
  74. margin-top: -1.6em;
  75. margin-bottom: 1.6em;
  76. }
  77. }
  78.  
  79. /* whitespace */
  80. if get-ws {
  81. if head-mg {
  82. .g div.r > a > br:first-child ~ h3 {
  83. margin-bottom: -1px;
  84. }
  85. if invert-lines {
  86. }
  87. }
  88. if line-h != 1.57 {
  89. .g .st, .g .s > div {
  90. line-height: line-h;
  91. }
  92. }
  93. if bottom-mg != 27px {
  94. .g {
  95. --margin-b: bottom-mg;
  96. margin-bottom: bottom-mg;
  97. }
  98. }
  99. }
  100.  
  101. /* to prevent the userstyle from disappearing from stylus menu when all options are disabled */
  102. .none {
  103. dummy:1;
  104. }
  105.  
  106. }

QingJ © 2025

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