Guy001

userChrome.css for a more compact Firefox UI

Oct 31st, 2024 (edited)
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 5.33 KB | None | 0 0
  1. /* Note that I have the top Menu Bar visible so if you don't it will cut off the top of the tab bar */
  2. /* Also note that I'm on Firefox Nightly, so some differences from the main version might be expected */
  3.  
  4.  
  5. /* 01. Menu Bar height */
  6. #toolbar-menubar { /* also works with #menubar-items but requires more padding reduction */
  7.   margin-top: -2px !important;
  8.   margin-bottom: -2px !important;
  9.   padding-top: -2px !important;
  10.   padding-bottom: -2px !important;
  11. }
  12. /* 01.1 Height of the window controls (close/min/max) which also affects the menu bar height */
  13. #toolbar-menubar .titlebar-button {
  14.   padding-block: 0px !important;
  15. }
  16.  
  17. /* 01.2 Aligning "Manage Boorkmarks" to the left, causing the Bookmarks menu to be narrower */
  18. #bookmarksShowAll {
  19.   padding-left: 0px !important;
  20.   margin-left: -10px !important;
  21. }
  22.  
  23. /* 02. Tabs/Tab Bar height */
  24. :root {
  25.  --tab-min-height: 20px !important;
  26. }
  27. #TabsToolbar {
  28.   max-height: 25px !important;
  29. }
  30.  
  31. /* 02.1 decreasing the bottom padding of the tabs toolbar */
  32. #TabsToolbar {
  33.   margin-bottom: -3px !important;
  34. }
  35.  
  36. /* 02.2 padding of the New Tab button */
  37. #tabs-newtab-button {
  38.   padding-left: 3px !important;
  39. }
  40.  
  41. /* 02.3 padding of the site icon on a tab */
  42. stack.tab-icon-stack {
  43.   margin: -3px !important;
  44. }
  45.  
  46. /* 02.4 padding and vertical alignment of the audio button on a tab (mute/unmute) */
  47. moz-button.tab-audio-button  {
  48.   margin: -1px !important;
  49.   padding-bottom: 1px !important;
  50. }
  51.  
  52. /* 02.5 vertically aligning the text part of the tab with the site icon */
  53. /* label.tab-text.tab-label {
  54.   padding-bottom: 0px !important;
  55. } */
  56.  
  57. /* 03. Address bar/URL bar/Toolbar height */
  58. /* partially based on https://github.com/CarterSnich/firefox-xtra-compact/blob/master/chrome/userChrome.css */
  59. toolbar#nav-bar {
  60.   height: 25px !important;
  61. }
  62. .urlbar-input-container {
  63.   height: 24px !important;
  64.   margin-top: 4px !important;
  65. }
  66. #urlbar-background {
  67.   height: 21px !important;
  68.   margin-top: 5px !important;
  69. }
  70.  
  71. /* 03.1 centering the url text line vertically */
  72. #urlbar-input {
  73.   padding-bottom: 2px !important;
  74. }
  75.  
  76. /* 03.2 removing the empty spaces in the toolbar sides */
  77. #back-button {
  78.   padding-left: 0px !important;
  79. }
  80. #PanelUI-menu-button {
  81.   padding-right: 0px !important;
  82. }
  83.  
  84. /* 03.3 Removing the extra space to the sides of the address bar (field) */
  85. #urlbar-container {
  86.   margin: 0px !important;
  87. }
  88.  
  89. /* 03.4 height/placement of the "go" arrow when typing/searching in the urlbar */
  90. #urlbar-go-button {
  91.   padding-top: 0px !important;
  92.   padding-bottom: 0px !important;
  93.   line-height: 20px !important;
  94.   max-height: 20px !important;
  95. }
  96.  
  97. /* 03.5 reducing padding of the icons to the left of the address (in the field itself) */
  98. #tracking-protection-icon-container, #identity-icon-box, #identity-permission-box, #eme-notification-icon {
  99.   padding: 3px !important;
  100. }
  101.  
  102. /* 03.6 Vertical placement of the DRM icon in the address field */
  103. #eme-notification-icon {
  104.   margin-top: -7px !important;
  105. }
  106.  
  107. /* 03.7 reducing spacing/padding of toolbar buttons (navigation/addons/window controls) */
  108. toolbarbutton {
  109.   margin: -1px !important;
  110. }
  111. :root {
  112.   --toolbarbutton-outer-padding: 0px !important;
  113.   --toolbarbutton-inner-padding: 5px !important;
  114. }
  115. .toolbaritem-combined-buttons:not([widget-type='button-and-view']) {
  116.   margin-inline: 0px !important;
  117.   margin-inline-start: 0px !important;
  118.   margin-inline-end: 0px !important;
  119. }
  120.  
  121. /* 03.8 reducing spacing between padlock icon and url */
  122. #identity-box {
  123.   margin: 0px !important;
  124. }
  125.  
  126. /* 03.9 reducing padding of the application menu button ("hamburger menu", on the right side of the toolbar) */
  127. #PanelUI-menu-button {
  128.   margin: -4px !important;
  129. }
  130.  
  131.  
  132. /* 04. Menus/Menu Items height/padding */
  133. menupopup > menu:not(bookmarksPopup), /* this is for the lines of the sub-menus/folders/containers */
  134. menupopup > menuitem:not(bookmarksPopup) {
  135.   padding-block: 3px !important; /* above and below each item */
  136.   margin-left: -2px !important; /* margin is the outer space around an item */
  137.   padding-left: 8px !important; /* padding is the inner space inside an item */
  138.   margin-right: 0px !important;
  139.   padding-right: 6px !important;
  140. }
  141.  
  142. /* 04.1 removing padding for the menu itself so that the highlighting of a menu item covers the whole line */
  143. menupopup {
  144.   --panel-padding: 0px !important;
  145. }
  146.  
  147. /* 04.2 removing padding for separators in menus */
  148. menuseparator {
  149.   padding-block: 0px !important;
  150. }
  151.  
  152. /* 04.3 padding of the application menu ("hamburger menu") and extensions menu in the toolbar */
  153. :root{
  154. --arrowpanel-menuitem-padding: 1px !important; /* vertical and horizontal padding of the addon lines in the extensions menu */
  155. --arrowpanel-menuitem-margin-inline: 1px !important; /* vertical padding of the addon lines in the extensions menu */
  156. --panel-separator-margin-horizontal: 0px !important; /* vertical padding of Extensions title + horizontal padding of separators */
  157. --arrowpanel-menuitem-padding-block: 0px !important; /* vertical padding of the Zoom line in the hamburger menu */
  158. --panel-subview-body-padding-block: 0px !important; /* vertical padding of the hamburger menu itself */
  159. }
  160.  
  161. /* 04.4 fixing the visibility of badges (tickers) on addon icons in the extensions menu (they get cut off vertically due to the padding changes above) */
  162. #unified-extensions-view .toolbarbutton-badge {
  163.   margin-top: 0px !important;
  164. }
Advertisement
Add Comment
Please, Sign In to add comment