Advertisement
Guy001

userChrome.css for a more compact Firefox UI

Oct 31st, 2024 (edited)
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.93 KB | None | 0 0
  1. /* Note that this is done on Firefox Nightly, so some differences from the main version might be expected */
  2.  
  3.  
  4. /* 01. Menu Bar height */
  5. #toolbar-menubar { /* also works with #menubar-items but requires more padding reduction */
  6.   margin-top: -2px !important;
  7.   margin-bottom: -2px !important;
  8.   padding-top: -2px !important;
  9.   padding-bottom: -2px !important;
  10. }
  11. /* 01.1 Height of title bar buttons (close/min/max) which also affects the menu bar height */
  12. #toolbar-menubar .titlebar-button {
  13.   padding-block: 0px !important;
  14. }
  15.  
  16. /* 02. Tabs/Tab Bar height */
  17. :root {
  18.  --tab-min-height: 20px !important;
  19. }
  20. #TabsToolbar {
  21.   max-height: 25px !important;
  22. }
  23.  
  24. /* 02.1 decreasing the bottom padding of the tabs toolbar */
  25. #TabsToolbar {
  26.   margin-bottom: -3px !important;
  27. }
  28.  
  29. /* 02.2 padding of the New Tab button */
  30. #tabs-newtab-button {
  31.   padding-left: 3px !important;
  32. }
  33.  
  34. /* 02.3 padding of the site icon on a tab */
  35. stack.tab-icon-stack {
  36.   margin: -3px !important;
  37. }
  38.  
  39. /* 02.4 padding and vertical alignment of the audio button on a tab (mute/unmute) */
  40. moz-button.tab-audio-button  {
  41.   margin: -1px !important;
  42.   padding-bottom: 1px !important;
  43. }
  44.  
  45. /* 03. Address bar/URL bar/Toolbar height */
  46. /* partially based on https://github.com/CarterSnich/firefox-xtra-compact/blob/master/chrome/userChrome.css */
  47. toolbar#nav-bar {
  48.   height: 25px !important;
  49. }
  50. .urlbar-input-container {
  51.   height: 24px !important;
  52.   margin-top: 4px !important;
  53. }
  54. #urlbar-background {
  55.   height: 21px !important;
  56.   margin-top: 5px !important;
  57. }
  58.  
  59. /* 03.1 centering the url text line vertically */
  60. #urlbar-input {
  61.   padding-bottom: 2px !important;
  62. }
  63.  
  64. /* 03.2 removing the empty spaces in the toolbar sides */
  65. #back-button {
  66.   padding-left: 0px !important;
  67. }
  68. #PanelUI-menu-button {
  69.   padding-right: 0px !important;
  70. }
  71.  
  72. /* 03.3 height/placement of the "go" arrow when typing/searching in the urlbar */
  73. #urlbar-go-button {
  74.   padding-top: 0px !important;
  75.   padding-bottom: 0px !important;
  76.   line-height: 20px !important;
  77.   max-height: 20px !important;
  78. }
  79.  
  80. /* 03.4 padding of the left-side icons in the url bar */
  81. #tracking-protection-icon-container, #identity-icon-box, #identity-permission-box, #eme-notification-icon {
  82.   padding: 4px !important;
  83. }
  84.  
  85. /* 03.5 Vertical placement of the DRM icon in the url bar */
  86. #eme-notification-icon {
  87.   margin-top: -7px !important;
  88. }
  89.  
  90. /* 03.6 spacing/padding around addon icons in the toolbar/urlbar */
  91. :root {
  92.   --toolbarbutton-outer-padding: 0px !important;
  93.   --toolbarbutton-inner-padding: 5px !important;
  94. }
  95. .toolbaritem-combined-buttons:not([widget-type='button-and-view']),
  96. .toolbaritem-menu-buttons {
  97.   margin-inline: 0px !important;
  98.   margin-inline-start: 0px !important;
  99.   margin-inline-end: 0px !important;
  100. }
  101.  
  102. /* 04. Menus/Menu Items height/padding */
  103. menupopup > menu:not(bookmarksPopup), /* this is for the lines of the sub-menus/folders/containers */
  104. menupopup > menuitem:not(bookmarksPopup) {
  105.   padding-block: 3px !important; /* above and below each item */
  106.   margin-left: -2px !important; /* margin is the outer space around an item */
  107.   padding-left: 8px !important; /* padding is the inner space inside an item */
  108.   margin-right: 0px !important;
  109.   padding-right: 6px !important;
  110. }
  111.  
  112. /* 04.1 removing padding for the menu itself so that the highlighting of a menu item covers the whole line */
  113. menupopup {
  114.   --panel-padding: 0px !important;
  115. }
  116.  
  117. /* 04.2 removing padding for separators in menus */
  118. menuseparator {
  119.   padding-block: 0px !important;
  120. }
  121.  
  122. /* 04.3 padding of the "hamburger menu" and extensions menu in the toolbar */
  123. /* the values in the first line refer to the top-bottom and left-right padding respectively */
  124. :root{
  125. --arrowpanel-menuitem-padding: 1px 1px !important;
  126. --arrowpanel-menuitem-margin-inline: 1px !important;
  127. --arrowpanel-menuitem-padding-block: 1px !important;
  128. --panel-separator-margin-horizontal: 1px !important;
  129. --panel-subview-body-padding-block: 1px !important;
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement