GitHub - single column with important info on the top

Right sidebar at repository page with description and other becomes top row, readme pulled above files.

当前为 2021-04-07 提交的版本,查看 最新版本

  1. /* ==UserStyle==
  2. @name GitHub - single column with important info on the top
  3. @namespace myfonj
  4. @version 1.6.0
  5. @description Right sidebar at repository page with description and other becomes top row, readme pulled above files.
  6. @author myf
  7. ==/UserStyle== */
  8. @-moz-document domain("github.com") {
  9. /* just for categorization */
  10. }
  11. @-moz-document regexp("^https?://github.com/(?!password_reset|settings)([^#?/]+)/([^#?/]+)/?([#?].*)?$") {
  12. /*
  13. GitHub - single column with important info on the top
  14. https://greasyfork.org/en/scripts/406729/versions/new
  15.  
  16. examples
  17. https://github.com/mmulet/code-relay
  18. few contributors, many columns
  19. https://github.com/mozilla/readability
  20. used by ..
  21. https://github.com/GoogleChromeLabs/dark-mode-toggle
  22. many tags, much everything
  23. https://github.com/WebReflection/sqlite-worker
  24. five columns
  25. https://github.com/rilwis/bamboo
  26. fork, just two columns
  27. https://github.com/mozilla/standards-positions
  28. no about, no tags
  29. https://github.com/mcmilk/7-Zip-zstd/
  30. sponsor
  31. */
  32. /* unify main max width and centering
  33. */
  34. main > div {
  35. max-width: none !important;
  36. max-width: 80rem !important;
  37. max-width: 90rem !important;
  38. margin-left: auto;
  39. margin-right: auto;
  40. }
  41. /* Header row with name, description for mobile, tabs, etc */
  42. main > div:first-child {
  43. display: flex;
  44. flex-direction: column;
  45. background-color: transparent !important;
  46. padding-top: 0 !important;
  47. }
  48. /* "Tabs" (Code , PRs, Actions, ... ) pull above main heading */
  49. main > div:first-child > nav {
  50. order: -1;
  51. margin-bottom: 1rem;
  52. }
  53. /* main "columns" wrapper (files | sidebar) - convert to reversed rows */
  54. .repository-content > div > div:last-child {
  55. flex-direction: column-reverse !important;
  56. }
  57. /* Files, Sidebar - now rows*/
  58. .repository-content > div > div:last-child > div {
  59. width: auto;
  60. }
  61. /*
  62. main column - wrapper of:
  63. - file navigation (branches, tags left, goto, file right)
  64. - files (moved to bottom, except for 1. "row" with latest commit positioned to file navigation)
  65. - readme (moved under file navigation)
  66. */
  67. .repository-content > div > div:last-child > div:first-child {
  68. position: relative;
  69. display: flex;
  70. flex-direction: column;
  71. }
  72. .repository-content > div > div:last-child > div:first-child > .file-navigation {
  73. order: -2;
  74. }
  75. /*
  76. Readme - move before files files
  77. there are two kinds of readme blocks:
  78. - "fancy" readme-toc component with kebab menu of headings (introduced around 2021-03-26)
  79. - see e.g. https://github.com/SerenityOS/serenity
  80. - "normal" div#readme
  81. - see e.g. https://github.com/mozilla/readability
  82. */
  83. .repository-content > div > div:last-child > div:first-child > readme-toc,
  84. .repository-content > div > div:last-child > div:first-child > #readme {
  85. order: -1;
  86. }
  87. .repository-content > div > div:last-child > div:first-child > readme-toc > #readme > :first-child {
  88. /*
  89. TODO this sticky "README.md" box with TOC button feels really unnecessary
  90. probably nuke or compact it in the future
  91. * /
  92. display: none !important;
  93. /**/
  94. }
  95. /*
  96. sidebar - now top content
  97. for god's sake, THIS div should be MAIN and should be near H1 or something
  98. not suffocated at the end of the document in sidebar
  99. */
  100. .repository-content > div > div:last-child > div:last-child > div {
  101. display: flex;
  102. flex-direction: row;
  103. /* let's try without
  104. flex-wrap: wrap;
  105. now */
  106. padding-bottom: 1rem;
  107. }
  108. /* all main flex items (about .. languages)*/
  109. .repository-content > div > div:last-child > div:last-child > div > * {
  110. flex-grow: 1;
  111. flex-shrink: 10;
  112. border-left: 1px solid var(--color-border-secondary);
  113. border-left: none;
  114. padding-left: .5rem;
  115. padding-right: .5rem;
  116. padding-bottom: 1rem;
  117. }
  118. /*
  119. first "about" cell
  120. */
  121. .repository-content > div > div:last-child > div:last-child > div:first-child > div:first-child {
  122. flex-basis: 25rem;
  123. flex-grow: 50;
  124. flex-shrink: 1;
  125. border-left: none;
  126. padding-left: 0;
  127. }
  128. /* unnecessary link icon, may cause wrap, hide */
  129. .repository-content > div > div:last-child > div:last-child > div:first-child > div:first-child .octicon-link {
  130. display: none;
  131. }
  132. /* last "(programming) languages" cell */
  133. .repository-content > div > div:last-child > div:last-child > div:first-child > div:last-child {
  134. flex-shrink: 100;
  135. /* let's try without limiting */
  136. }
  137. /* no border nor paddings */
  138. .repository-content > div > div:last-child > div:last-child > div > div > div {
  139. border: none;
  140. padding: 0;
  141. }
  142. /* headings */
  143. .repository-content > div > div:last-child > div:last-child > div > div > div > h2 ,
  144. .repository-content > div > div:last-child > div:last-child > div > div > div > h2 > a {
  145. white-space: nowrap !important;
  146. }
  147. /* tags in about cell - restack and dim */
  148. .repository-content > div > div:last-child > div:last-child > div:first-child > div .f6:not(:hover) {
  149. opacity: 0.5;
  150. }
  151. .repository-content > div > div:last-child > div:last-child > div:first-child > div .f6 {
  152. display: flex;
  153. flex-wrap: wrap;
  154. }
  155. .repository-content > div > div:last-child > div:last-child > div:first-child > div .f6 > * {
  156. flex-grow: 1;
  157. text-align: center;
  158. }
  159. /* "used by 108" - make 8 avatars wrap */
  160. .hx_flex-avatar-stack {
  161. flex-wrap: wrap;
  162. max-width: 10rem;
  163. padding-right: .8rem;
  164. }
  165. /* allowing wrap of counter under "used by" avatars */
  166. .repository-content > div > div:last-child > div:last-child > div:first-child > div .d-flex.flex-items-center {
  167. flex-wrap: wrap;
  168. }
  169. /*
  170. un-truncating everything to allow wrapping of long (esp. in "releases" cell
  171. affects "releases", but whatever
  172. */
  173. .repository-content > div > div:last-child > div:last-child > div > * * {
  174. white-space: normal !important;
  175. }
  176. /* un-flexing latest release */
  177. .repository-content > div > div:last-child > div:last-child > div > * .Link--primary.d-flex * { display: block !important}
  178.  
  179. /* superfluous link icon in "sponsor this project" */
  180. .repository-content > div > div:last-child > div:last-child > div > * [style="min-width:32px;height:32px;"] {
  181. display: none !important;
  182. }
  183. /* environments "active" tag below text */
  184. .repository-content > div > div:last-child > div:last-child > div > * h2 + .list-style-none li .Label {
  185. display: block;
  186. }
  187. /*
  188. last commit & "commits" link
  189. normally above files table, moving into file navigation
  190. */
  191. .repository-content > div > div:last-child > div:first-child .Box-header {
  192. position: absolute !important;
  193. padding: 0;
  194. top: .33rem;
  195. border: none;
  196. left: 16rem; /* space for branch selector, branches, tags */
  197. right: 21rem; /* space for Go to file, Add file, Code/clone */
  198. background-color: transparent !important;
  199. z-index: 90; /* for "..." unfolding */
  200. }
  201. /* hide hash */
  202. .repository-content > div > div:last-child > div:first-child .Box-header .text-mono {
  203. display: none !important
  204. }
  205. /* reverse order so commit count ends up beside tag count */
  206. .repository-content > div > div:last-child > div:first-child .Box-header > div > :last-child {
  207. order: -1;
  208. padding-right: 1rem;
  209. }
  210. /* hide "commits" text (lave icon) (more space for last commit msg) */
  211. .repository-content > div > div:last-child > div:first-child .Box-header > div > :last-child .color-text-secondary {
  212. display: none !important;
  213. }
  214. /* hide "branches" and "tags" text (lave icons) (more space for last commit msg) */
  215. .file-navigation .color-text-tertiary{
  216. display: none;
  217. }
  218. }