GitHub

Fix formatting

  1. // ==UserScript==
  2. // @name GitHub
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.6
  5. // @description Fix formatting
  6. // @author Ping
  7. // @match https://github.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var head = document.getElementsByTagName('head')[0];
  15. var style = document.createElement('style');
  16. style.type = 'text/css';
  17. style.innerHTML = `
  18.  
  19. /* Reduce height of repository search bar */
  20. .header {
  21. padding: 6px 0;
  22. }
  23.  
  24. /* Reduce spacing around page heading and repo heading */
  25. .pagehead {
  26. padding-top: 12px;
  27. }
  28. .pagehead, .repohead {
  29. margin-bottom: 12px;
  30. }
  31.  
  32. /* Reduce height of tabs */
  33. a.reponav-item, .tabnav-tab {
  34. line-height: 16px;
  35. }
  36.  
  37. /* Reduce line spacing in code */
  38. .blob-num, .blob-code-inner {
  39. font-size: 11px;
  40. }
  41. .blob-num, .blob-code {
  42. line-height: 14px;
  43. vertical-align: baseline;
  44. }
  45. .add-line-comment {
  46. height: 18px;
  47. }
  48.  
  49. /* Reduce vertical padding in file header */
  50. .file-header {
  51. padding: 0 10px;
  52. }
  53. .btn-sm, .social-count {
  54. line-height: 17px;
  55. }
  56.  
  57. /* Reduce space between files */
  58. .files-next-bucket .file {
  59. margin-bottom: 16px;
  60. }
  61.  
  62. /* Reduce padding above diff summary bar */
  63. .pr-toolbar, .pr-toolbar.is-stuck::after {
  64. height: 40px;
  65. margin-bottom: 10px;
  66. }
  67. .diffbar {
  68. padding-top: 10px;
  69. }
  70. .pr-toolbar.is-stuck + .pr-toolbar-shadow {
  71. top: 40px;
  72. }
  73.  
  74. /* See more content in commit status descriptions. */
  75. .branch-action-item.open > .merge-status-list {
  76. max-height: none;
  77. }
  78. .merge-status-item {
  79. padding: 6px 12px;
  80. }
  81. .merge-status-item .css-truncate-target {
  82. white-space: normal;
  83. }
  84. `;
  85. head.appendChild(style);
  86. })();