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-03-29 提交的版本,查看 最新版本

  1. /* ==UserStyle==
  2. @name GitHub - single column with important info on the top
  3. @namespace myfonj
  4. @version 1.4.2
  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. */
  30. /* unify main max width and centering
  31. */
  32. main > div {
  33. max-width: none !important;
  34. max-width: 80rem !important;
  35. max-width: 90rem !important;
  36. margin-left: auto;
  37. margin-right: auto;
  38. }
  39. /* Header row with name, description for mobile, tabs, etc */
  40. main > div:first-child {
  41. display: flex;
  42. flex-direction: column;
  43. background-color: transparent !important;
  44. padding-top: 0 !important;
  45. }
  46. /* "Tabs" (Code , PRs, Actions, ... ) pull above main heading */
  47. main > div:first-child > nav {
  48. order: -1;
  49. margin-bottom: 1rem;
  50. }
  51. /* main "columns" wrapper (files | sidebar) - convert to reversed rows */
  52. .repository-content > div > div:last-child {
  53. flex-direction: column-reverse !important;
  54. }
  55. /* Files, Sidebar - now rows*/
  56. .repository-content > div > div:last-child > div {
  57. width: auto;
  58. }
  59. /*
  60. main column - wrapper of:
  61. - file navigation (branches, tags left, goto, file right)
  62. - files (moved to bottom, except for 1. "row" with latest commit positioned to file navigation)
  63. - readme (moved under file navigation)
  64. */
  65. .repository-content > div > div:last-child > div:first-child {
  66. position: relative;
  67. display: flex;
  68. flex-direction: column;
  69. }
  70. .repository-content > div > div:last-child > div:first-child > .file-navigation {
  71. order: -2;
  72. }
  73. /*
  74. Readme - move before files files
  75. there are two kinds of readme blocks:
  76. - "fancy" readme-toc component with kebab menu of headings (introduced around 2021-03-26)
  77. - see e.g. https://github.com/SerenityOS/serenity
  78. - "normal" div#readme
  79. - see e.g. https://github.com/mozilla/readability
  80. */
  81. .repository-content > div > div:last-child > div:first-child > readme-toc,
  82. .repository-content > div > div:last-child > div:first-child > #readme {
  83. order: -1;
  84. }
  85. /*
  86. last commit & "commits" link
  87. normally above files table, moving into file navigation
  88. */
  89. .repository-content > div > div:last-child > div:first-child > div:nth-child(2) > div:first-child {
  90. position: absolute !important;
  91. padding: 0;
  92. top: .33rem;
  93. border: none;
  94. left: 22rem; /* space for branch selector, branches, tags */
  95. right: 22rem; /* space for Go to file, Add file, Code/clone */
  96. background-color: transparent !important;
  97. }
  98. /* reverse order so commit count ends up beside tag count */
  99. .repository-content > div > div:last-child > div:first-child > div:nth-child(2) > div:first-child > div {
  100. flex-direction: row-reverse;
  101. }
  102. /*
  103. sidebar - now top content
  104. for god's sake, THIS div should be MAIN and should be near H1 or something
  105. not suffocated at the end of the document in sidebar
  106. */
  107. .repository-content > div > div:last-child > div:last-child > div {
  108. display: flex;
  109. flex-direction: row;
  110. /* let's try without
  111. flex-wrap: wrap;
  112. now */
  113. padding-bottom: 1rem;
  114. }
  115. /* flex items */
  116. .repository-content > div > div:last-child > div:last-child > div > * {
  117. flex-grow: 1;
  118. flex-shrink: 1000;
  119. border-left: 1px solid var(--color-border-secondary);
  120. border-left: none;
  121. padding-left: .5rem;
  122. padding-right: .5rem;
  123. padding-bottom: 1rem;
  124. }
  125. /*
  126. first "about" cell
  127. */
  128. .repository-content > div > div:last-child > div:last-child > div:first-child > div:first-child {
  129. flex-basis: 25rem;
  130. flex-grow: 10000;
  131. flex-shrink: 1;
  132. border-left: none;
  133. padding-left: 0;
  134. }
  135. /* last "(programming) languages" cell */
  136. .repository-content > div > div:last-child > div:last-child > div:first-child > div:last-child {
  137. /* let's try without limiting */
  138. }
  139. /*
  140. attempts to limit width of some cells and prevent wrapping
  141. sadly this also prevents auto growing them if they wrap :()
  142. */
  143. /* contributors */
  144. .repository-content > div > div:last-child > div:last-child > div:first-child > div:nth-last-child(2) {
  145.  
  146. }
  147. /* no border nor paddings */
  148. .repository-content > div > div:last-child > div:last-child > div > div > div {
  149. border: none;
  150. padding: 0;
  151. }
  152. /* headings */
  153. .repository-content > div > div:last-child > div:last-child > div > div > div > h2 > a {
  154. white-space: nowrap !important;
  155. }
  156. /* counters in header - considering there is always `+ 123` below, this sum is redundant, so what about removing it completely?
  157. * but not now /
  158. .repository-content > div > div:last-child > div:last-child > div > div > div > h2 .Counter {
  159. display: none
  160. }
  161. /* tags in about cell - restack and dim */
  162. .repository-content > div > div:last-child > div:last-child > div:first-child > div .f6:not(:hover) {
  163. opacity: 0.5;
  164. }
  165. .repository-content > div > div:last-child > div:last-child > div:first-child > div .f6 {
  166. display: flex;
  167. flex-wrap: wrap;
  168. max-width: 17rem;
  169. }
  170. .repository-content > div > div:last-child > div:last-child > div:first-child > div .f6 > * {
  171. flex-grow: 1;
  172. text-align: center;
  173. }
  174. /* "used by 108" - make 8 avatars wrap */
  175. .hx_flex-avatar-stack {
  176. flex-wrap: wrap;
  177. max-width: 10rem;
  178. padding-right: .8rem;
  179. }
  180. /* allowing wrap of counter under "used by" avatars */
  181. .repository-content > div > div:last-child > div:last-child > div:first-child > div .d-flex.flex-items-center {
  182. flex-wrap: wrap;
  183. }
  184. /*
  185. un-truncating everything to allow wrapping of long (esp. in "releases" cell
  186. affects "releases", but whatever
  187. */
  188. .repository-content > div > div:last-child > div:last-child > div > * * {
  189. white-space: normal !important;
  190. }
  191. }