Guy001

userChrome.css for a more compact Firefox UI

Oct 31st, 2024 (edited)
1,351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 9.17 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 Beta and not using the Nova design (browser.nova.enabled=false), so some differences might be expected */
  3. /* To enable the use of the file, enter [about:config](https://support.mozilla.org/en-US/kb/about-config-editor-firefox) in the address bar, then accept the warning if it appears. Search for "toolkit.legacyUserProfileCustomizations.stylesheets" and double-click it to set it to "true" */
  4. /* See a different version for LibreWolf: https://pastebin.com/dkgZBbxp (I don't use it as often so it might not be up-to-date) */
  5.  
  6.  
  7. /* 01. Menu Bar height */
  8. #toolbar-menubar { /* also works with #menubar-items but requires more padding reduction */
  9.   margin-top: -2px !important;
  10.   margin-bottom: -2px !important;
  11.   padding-top: -2px !important;
  12.   padding-bottom: -2px !important;
  13. }
  14. /* 01.1 Height of the window controls (close/min/max) which also affects the menu bar height */
  15. #toolbar-menubar .titlebar-button {
  16.   padding-block: 0px !important;
  17. }
  18.  
  19. /* 01.2 Aligning the top iconless options of the bookmarks menu to the left (makes the Bookmarks menu narrower if bookmarks names are shorter) */
  20. #bookmarksShowAll, #menu_bookmarkThisPage, #menu_bookmarkAllTabs {
  21.   padding-left: 0px !important;
  22.   margin-left: -10px !important;
  23. }
  24.  
  25. /* 01.3 setting a minimum width for the main bookmarks menu (for when the bookmark names are too short) */
  26. #bookmarksMenuPopup { min-width: 180px !important; }
  27.  
  28. /* 02. Tabs/Tab Bar height */
  29. :root {
  30.  --tab-min-height: 18px !important;
  31. }
  32. #TabsToolbar {
  33.   max-height: 23px !important;
  34. }
  35. /* raise the tab text */
  36. /*.tab-label {
  37.   margin-top: -1px !important;
  38. }*/
  39.  
  40. /* 02.1 decreasing the bottom padding of the tabs toolbar, above the url bar */
  41. #TabsToolbar {
  42.   margin-bottom: -3px !important;
  43. }
  44.  
  45. /* 02.2 padding of the New Tab button */
  46. #tabs-newtab-button {
  47.   padding-left: 3px !important;
  48. }
  49.  
  50. /* 02.3 decreasing the spacing between the site icon and the tab's title */
  51. .tab-icon-stack {
  52.   margin-right: -4px !important;
  53. }
  54.  
  55. /* 02.4 reducing horizontal padding of tab content */
  56. .tab-content {
  57.   padding-right: 2px !important;
  58.   padding-left: 2px !important;
  59. }
  60. /* increasing vertical height of a tab's text */
  61. .tab-text {
  62.   padding-bottom: 1px !important;
  63. }
  64.  
  65. /* 02.5 reducing spacing between tabs */
  66. tab.tabbrowser-tab {
  67.   padding-right: 1px !important;
  68.   padding-left: 1px !important;
  69. }
  70.  
  71. /* 02.6 minimally rounded tabs (use 0px or 0% to remove rounded corners entirely) */
  72. /* thanks to a somewhat similar solution here https://www.reddit.com/r/FirefoxCSS/comments/1n8xv4s/. also see: https://www.reddit.com/r/firefox/comments/1vgtjna/no_more_rounded_corners_userchromecss_inside/ */
  73. .tab-background {
  74.   border-radius: 4px !important;
  75. }
  76.  
  77. /* 02.7 padding of the audio button on a tab (mute/unmute), spacing between the icon and the tab's title */
  78. .tab-audio-button  {
  79.   margin-right: -1px !important;
  80.   --button-size-icon-small: 20px !important;
  81.   --button-min-height-small: 20px !important;
  82. }
  83.  
  84.  
  85. /* 03. Address bar/URL bar/Toolbar */
  86. /* To prevent the address bar from "popping out" while clicking on it set "browser.urlbar.openViewOnFocus" to false in about:config */
  87.  
  88. /* 03.1 reducing empty horizontal space */
  89. /* in the toolbar sides */
  90. #back-button {
  91.   padding-left: 0px !important;
  92. }
  93. #PanelUI-menu-button {
  94.   padding-right: 0px !important;
  95. }
  96. /* space between url/address and icons inside the urlbar */
  97. .urlbar-input-box {
  98.   margin-left: 1px !important;
  99.   margin-right: 1px !important;
  100. }
  101.  
  102. /* 03.2 reducing the height of the toolbar/urlbar */
  103. /* also affected by "reducing spacing/padding of toolbar buttons" later */
  104. .urlbar {
  105.   --urlbar-height: 20px !important;
  106.   min-height: 20px !important;
  107.   max-height: 20px !important;
  108. }
  109. .urlbar-container {
  110.   --urlbar-container-height: 22px !important;
  111.   min-height: 22px !important;
  112.   max-height: 22px !important;
  113. }
  114. .urlbar-input-container { /* address line content including the icons/buttons */
  115.   min-height: 22px !important;
  116.   max-height: 22px !important;
  117.   padding-bottom: 1px !important;
  118. }
  119. .urlbar-input {
  120.   padding-bottom: 1px !important; /* address text line */
  121. }
  122. /* for reference, here's what I worked with before: #nav-bar { height: 23px !important; } .urlbar-input-container { height: 23px !important; margin-top: 4px !important; } .urlbar-background { height: 19px !important; margin-top: 5px !important; } */
  123. /* and then it ballooned into this while re-tweaking it possibly due to an ever-changing UI in Nightly: https://www.reddit.com/r/FirefoxCSS/comments/1tdnav1/toolbarurlbar_keeps_changing_with_every_new/ */
  124. /* */
  125. /* due to redcued height: fixing vertical placement of the address text line */
  126. .urlbar-input {
  127.   margin-top: -2px !important;
  128. }
  129. /* due to reduced height: increasing spacing of urlbar buttons inside the address bar */
  130. #notification-popup-box,
  131. #remote-control-box,
  132. #searchmode-switcher-panel,
  133. #searchmode-switcher-panel-list-urlbar,
  134. #urlbar-search-mode-indicator,
  135. #trust-icon-container /*Shield*/,
  136. #tracking-protection-icon-container,
  137. #urlbar-label-box,
  138. #identity-box, #identity-icon-box, /*Permissions/Extension/Firefox button, and search icon*/
  139. #identity-permission-box,
  140. #urlbar-revert-button-container,
  141. #page-action-buttons, /* right-side buttons (like "bookmark this page", or the zoom when it is set) */
  142. #eme-notification-icon /*DRM*/ {
  143.   padding-right: 1px !important;
  144.   padding-left: 1px !important;
  145.   margin-right: 0px !important; /* because the #identity-box margin-right became 6px */
  146. }
  147.  
  148. /* 03.3 reducing spacing/padding of toolbar buttons (navigation/addons/window controls) */
  149. toolbarbutton {
  150.   margin: -1px !important;
  151. }
  152. /* all icons/buttons in the toolbar around the urlbar, including pinned addons icons */
  153. :root {
  154.   --toolbarbutton-padding-outer: 0px !important;
  155.   --toolbarbutton-padding-inner: 4px !important;
  156. }
  157. /* spacing between toolbar buttons */
  158. .toolbarbutton-1 {
  159.   margin-left: -2px !important;
  160.   margin-right: -2px !important;
  161. }
  162. /* spacing between urlbar and buttons on both sides */
  163. :root {
  164.   --urlbar-margin-inline: 1px !important;
  165. }
  166.  
  167. /* 03.3.1 padding of the Permissions/Extension/Firefox button next to the address */
  168. #identity-icon-box {
  169.   padding-right: 1px !important;
  170.   padding-left: 1px !important;
  171.   margin-block: -1px !important;
  172. }
  173.  
  174. /* 03.3.2 lowering the badges (tickers) on pinned addon icons + update dot on hamburger menu */
  175. .toolbarbutton-1 .toolbarbutton-badge {
  176.   margin-top: -3px !important;
  177. }
  178.  
  179. /* 03.4 reducing the horizontal padding of the application menu button ("hamburger menu", 3-line button on the right side of the toolbar) */
  180. #PanelUI-menu-button > stack {
  181.   padding-left: 3px !important;
  182.   padding-right: 3px !important;
  183. }
  184.  
  185. /* 03.5 reverting to a less rounded button background while hovering over it + urlbar background */
  186. :root {
  187.   --button-border-radius: 4px !important;
  188.   --urlbarview-border-radius: 4px !important;
  189. }
  190.  
  191.  
  192. /* 04. Menus/Menu Items height/padding */
  193. menupopup > menu:not(bookmarksPopup), /* this is for the lines of the sub-menus/folders/containers */
  194. menupopup > menuitem:not(bookmarksPopup) {
  195.   padding-block: 3px !important; /* above and below each item */
  196.   margin-left: -2px !important; /* margin is the outer space around an item */
  197.   padding-left: 8px !important; /* padding is the inner space inside an item */
  198.   margin-right: 0px !important;
  199.   padding-right: 6px !important;
  200. }
  201.  
  202. /* 04.1 removing padding for the menu itself so that the highlighting of a menu item covers the whole line */
  203. menupopup {
  204.   --panel-padding: 0px !important;
  205. }
  206.  
  207. /* 04.2 removing padding for separators in menus */
  208. menuseparator {
  209.   padding-block: 0px !important;
  210. }
  211.  
  212. /* 04.3 Reducing padding in the application menu ("hamburger menu") and extensions menu */
  213. #unified-extensions-panel /* extensions menu */ {
  214. --panel-menuitem-margin: 0px !important;
  215. --panel-menuitem-margin-inline: 0px !important;
  216. --panel-menuitem-padding: 1px !important;
  217. --panel-menuitem-padding-inline: 3px !important;
  218. }
  219. #appMenu-mainView /* application menu */ {
  220. --panel-menuitem-padding: 2px !important;
  221. --panel-menuitem-margin: 0px !important; /* only affects the Zoom line */
  222. }
  223. #appMenu-zoom-controls /* additional zoom line padding (height) */ {
  224.   padding: 0px !important;
  225. }
  226. /* vertical padding of "Extensions" title in the extensions menu */
  227. #unified-extensions-view .panel-header {
  228.   min-height: 25px !important;
  229. }
  230. /* vertical padding of the application menu (top and bottom) */
  231. #appMenu-mainView .panel-subview-body  {
  232.   padding: 0px !important;
  233. }
  234. /* fixing the visibility of badges (tickers) on addon icons in the extensions menu (they get cut off vertically due to the padding changes above) */
  235. #unified-extensions-view .toolbarbutton-badge {
  236.   margin-top: 0px !important;
  237.   max-width: 100% !important;
  238. }
  239. /* increasing the left margin of the "Manage extensions" text at the bottom of the extensions menu */
  240. #unified-extensions-manage-extensions .toolbarbutton-text {
  241.   margin-left: 5px !important;
  242. }
  243.  
  244. /* Reducing the padding in the autofill menu */
  245. .autocomplete-richlistitem {
  246.   margin-top: -5px !important;
  247. }
  248. .autocomplete-richlistbox {
  249.   margin: -8px !important;
  250. }
  251.  
Advertisement
Add Comment
Please, Sign In to add comment