Advertisement
Guy001

userChrome.css for a more compact Firefox UI

Oct 31st, 2024 (edited)
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.75 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: -2px !important;
  37. }
  38.  
  39. /* 03. Address bar/URL bar/Toolbar height */
  40. /* partially based on https://github.com/CarterSnich/firefox-xtra-compact/blob/master/chrome/userChrome.css */
  41. toolbar#nav-bar {
  42.   height: 25px !important;
  43. }
  44. .urlbar-input-container {
  45.   height: 24px !important;
  46.   margin-top: 4px !important;
  47. }
  48. #urlbar-background {
  49.   height: 21px !important;
  50.   margin-top: 5px !important;
  51. }
  52.  
  53. /* 03.1 centering the url text line vertically */
  54. #urlbar-input {
  55.   padding-bottom: 2px !important;
  56. }
  57.  
  58. /* 03.2 removing the empty spaces in the toolbar sides */
  59. #back-button {
  60.   padding-left: 0px !important;
  61. }
  62. #PanelUI-menu-button {
  63.   padding-right: 0px !important;
  64. }
  65.  
  66. /* 03.3 height/placement of the "go" arrow when typing/searching in the urlbar */
  67. #urlbar-go-button {
  68.   padding-top: 0px !important;
  69.   padding-bottom: 0px !important;
  70.   line-height: 20px !important;
  71.   max-height: 20px !important;
  72. }
  73.  
  74. /* 03.4 padding of the left-side icons in the url bar */
  75. #tracking-protection-icon-container, #identity-icon-box, #identity-permission-box, #eme-notification-icon {
  76.   padding: 4px !important;
  77. }
  78.  
  79. /* 03.5 Vertical placement of the DRM icon in the url bar */
  80. #eme-notification-icon {
  81.   margin-top: -7px !important;
  82. }
  83.  
  84. /* 03.6 spacing/padding around addon icons in the toolbar/urlbar */
  85. :root {
  86.   --toolbarbutton-outer-padding: 0px !important;
  87.   --toolbarbutton-inner-padding: 5px !important;
  88. }
  89. .toolbaritem-combined-buttons:not([widget-type='button-and-view']),
  90. .toolbaritem-menu-buttons {
  91.   margin-inline: 0px !important;
  92.   margin-inline-start: 0px !important;
  93.   margin-inline-end: 0px !important;
  94. }
  95.  
  96. /* 04. Menus/Menu Items height/padding */
  97. menupopup > menu:not(bookmarksPopup), /* this is for the lines of the sub-menus/folders/containers */
  98. menupopup > menuitem:not(bookmarksPopup) {
  99.   padding-block: 3px !important; /* above and below each item */
  100.   margin-left: -2px !important; /* margin is the outer space around an item */
  101.   padding-left: 8px !important; /* padding is the inner space inside an item */
  102.   margin-right: 0px !important;
  103.   padding-right: 6px !important;
  104. }
  105.  
  106. /* 04.1 removing padding for the menu itself so that the highlighting of a menu item covers the whole line */
  107. menupopup {
  108.   --panel-padding: 0px !important;
  109. }
  110.  
  111. /* 04.2 removing padding for separators in menus */
  112. menuseparator {
  113.   padding-block: 0px !important;
  114. }
  115.  
  116. /* 04.3 padding of the "hamburger menu" and extensions menu in the toolbar */
  117. /* the values in the first line refer to the top-bottom and left-right padding respectively */
  118. :root{
  119. --arrowpanel-menuitem-padding: 1px 1px !important;
  120. --arrowpanel-menuitem-margin-inline: 1px !important;
  121. --arrowpanel-menuitem-padding-block: 1px !important;
  122. --panel-separator-margin-horizontal: 1px !important;
  123. --panel-subview-body-padding-block: 1px !important;
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement