Guy001

userChrome.css for a more compact Firefox UI

Oct 31st, 2024 (edited)
652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 6.40 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. /* Don't use in LibreWolf */
  14. #toolbar-menubar .titlebar-button {
  15.   padding-block: 0px !important;
  16. }
  17.  
  18. /* 01.2 Aligning "Manage Boorkmarks" to the left, causing the Bookmarks menu to be narrower */
  19. #bookmarksShowAll {
  20.   padding-left: 0px !important;
  21.   margin-left: -10px !important;
  22. }
  23.  
  24. /* 02. Tabs/Tab Bar height */
  25. :root {
  26.  --tab-min-height: 20px !important;
  27. }
  28. /* For LibreWolf change this section to "#TabsToolbar, #tabbrowser-tabs { max-height: 22px !important; }" */
  29. #TabsToolbar {
  30.   max-height: 25px !important;
  31. }
  32.  
  33. /* 02.1 decreasing the bottom padding of the tabs toolbar */
  34. #TabsToolbar {
  35.   margin-bottom: -3px !important;
  36. }
  37.  
  38. /* 02.2 padding of the New Tab button */
  39. #tabs-newtab-button {
  40.   padding-left: 3px !important;
  41. }
  42.  
  43. /* 02.3 decreasing the spacing between the site icon and the tab's title */
  44. stack.tab-icon-stack {
  45.   margin-right: -4px !important;
  46. }
  47.  
  48. /* 02.4 reducing horizontal padding of tab content */
  49. .tab-content {
  50.   padding-right: 2px !important;
  51.   padding-left: 2px !important;
  52. }
  53.  
  54. /* 02.5 reducing spacing between tabs */
  55. tab.tabbrowser-tab {
  56.   padding-right: 1px !important;
  57.   padding-left: 1px !important;
  58. }
  59.  
  60. /* 02.6 minimally rounded tabs (use 0px or 0% to remove rounded corners entirely) */
  61. /* thanks to a somewhat similar solution here https://www.reddit.com/r/FirefoxCSS/comments/1n8xv4s/ */
  62. .tab-background {
  63.   border-radius: 4px !important;
  64. }
  65.  
  66. /* 02.7 padding of the audio button on a tab (mute/unmute), spacing between the icon and the tab's title */
  67. .tab-audio-button  {
  68.   margin-right: -3px !important;
  69.   --button-size-icon-small: 20px !important;
  70.   --button-min-height-small: 20px !important;
  71. }
  72.  
  73. /* 03. Address bar/URL bar/Toolbar height */
  74. /* partially based on https://github.com/CarterSnich/firefox-xtra-compact/blob/master/chrome/userChrome.css */
  75. toolbar#nav-bar {
  76.   height: 25px !important;
  77. }
  78. .urlbar-input-container {
  79.   height: 24px !important;
  80.   margin-top: 4px !important;
  81. }
  82. .urlbar-background {
  83.   height: 21px !important;
  84.   margin-top: 5px !important;
  85. }
  86.  
  87. /* 03.1 centering the url text line vertically */
  88. #urlbar-input {
  89.   padding-bottom: 2px !important;
  90. }
  91.  
  92. /* 03.2 removing the empty spaces in the toolbar sides */
  93. #back-button {
  94.   padding-left: 0px !important;
  95. }
  96. #PanelUI-menu-button {
  97.   padding-right: 0px !important;
  98. }
  99.  
  100. /* 03.3 Removing the extra space to the sides of the address bar (field) */
  101. #urlbar-container {
  102.   margin: 0px !important;
  103. }
  104.  
  105. /* 03.4 height/placement of the "go" arrow when typing/searching in the urlbar */
  106. #urlbar-go-button {
  107.   padding-top: 0px !important;
  108.   padding-bottom: 0px !important;
  109.   line-height: 20px !important;
  110.   max-height: 20px !important;
  111. }
  112.  
  113. /* 03.5 reducing padding of the icons to the left of the address (in the field itself) */
  114. #tracking-protection-icon-container, #identity-icon-box, #identity-permission-box, #eme-notification-icon {
  115.   padding: 3px !important;
  116. }
  117.  
  118. /* 03.6 Vertical placement of the DRM icon in the address field */
  119. #eme-notification-icon {
  120.   margin-top: -7px !important;
  121. }
  122.  
  123. /* 03.7 reducing spacing/padding of toolbar buttons (navigation/addons/window controls) */
  124. toolbarbutton {
  125.   margin: -1px !important;
  126. }
  127. /* all icons/buttons in the toolbar around the urlbar */
  128. :root {
  129.   --toolbarbutton-outer-padding: 0px !important;
  130.   --toolbarbutton-inner-padding: 5px !important;
  131.   --toolbarbutton-outer-margin: 0px !important;
  132.   --toolbarbutton-inner-margin: 0px !important;
  133. }
  134. /* pinned addons icons */
  135. .toolbaritem-combined-buttons:not([widget-type='button-and-view']) {
  136.   margin-inline: 0px !important;
  137.   margin-inline-start: 0px !important;
  138.   margin-inline-end: 0px !important;
  139. }
  140. /* padding of the application menu button ("hamburger menu", on the right side of the toolbar) */
  141. #PanelUI-menu-button {
  142.   padding-left: 0px !important;
  143. }
  144. #PanelUI-menu-button > stack {
  145.   padding-left: 0px !important;
  146.   padding-right: 3px !important;
  147. }
  148.  
  149. /* 03.8 reducing spacing between padlock icon and url */
  150. #identity-box {
  151.   margin: 0px !important;
  152. }
  153.  
  154. /* 03.9 reverting to a less rounded icons background while hovering over them */
  155. :root {
  156.   --button-border-radius: 4px !important;
  157. }
  158.  
  159.  
  160. /* 04. Menus/Menu Items height/padding */
  161. menupopup > menu:not(bookmarksPopup), /* this is for the lines of the sub-menus/folders/containers */
  162. menupopup > menuitem:not(bookmarksPopup) {
  163.   padding-block: 3px !important; /* above and below each item */
  164.   margin-left: -2px !important; /* margin is the outer space around an item */
  165.   padding-left: 8px !important; /* padding is the inner space inside an item */
  166.   margin-right: 0px !important;
  167.   padding-right: 6px !important;
  168. }
  169.  
  170. /* 04.1 removing padding for the menu itself so that the highlighting of a menu item covers the whole line */
  171. menupopup {
  172.   --panel-padding: 0px !important;
  173. }
  174.  
  175. /* 04.2 removing padding for separators in menus */
  176. menuseparator {
  177.   padding-block: 0px !important;
  178. }
  179.  
  180. /* 04.3 padding of the application menu ("hamburger menu") and extensions menu in the toolbar */
  181. :root{
  182. --arrowpanel-menuitem-padding: 1px !important; /* vertical and horizontal padding of the addon lines in the extensions menu */
  183. --arrowpanel-menuitem-margin-inline: 1px !important; /* vertical padding of the addon lines in the extensions menu */
  184. --arrowpanel-menuitem-padding-block: 0px !important; /* vertical padding of the Zoom line in the hamburger menu */
  185. --panel-subview-body-padding-block: 0px !important; /* vertical padding of the hamburger menu itself */
  186. }
  187.  
  188. /* 04.4 vertical padding of Extensions title in the extensions menu */
  189. #unified-extensions-view .panel-header {
  190.   min-height: 25px !important;
  191. }
  192.  
  193. /* 04.5 fixing the visibility of badges (tickers) on addon icons in the extensions menu (they get cut off vertically due to the padding changes above) */
  194. #unified-extensions-view .toolbarbutton-badge {
  195.   margin-top: 0px !important;
  196.   max-width: 100% !important;
  197. }
Advertisement
Add Comment
Please, Sign In to add comment