Advertisement
Guest User

Firefox userchrome

a guest
Feb 17th, 2025
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.78 KB | None | 0 0
  1. /*---------------------------------*/
  2. /* 1. Force Tabs to Bottom */
  3. #TabsToolbar {
  4. order: 100 !important;
  5. }
  6.  
  7. /*---------------------------------*/
  8. /* 2. Dedicated Toolbar for Window Buttons */
  9. #titlebar {
  10. display: block !important;
  11. position: relative !important;
  12. height: 40px !important; /* Height of your toolbar */
  13. -moz-window-dragging: drag !important; /* Drag space */
  14. background: #232323 !important; /* Toolbar color */
  15. }
  16. /* Position buttons at the top-right */
  17. #titlebar-buttonbox-container {
  18. position: absolute !important;
  19. top: 0 !important;
  20. right: 0 !important;
  21. height: 40px !important;
  22. padding: 8px 12px !important; /* Spacing for buttons */
  23. z-index: 9999 !important;
  24. -moz-window-dragging: no-drag !important; /* Allow clicking */
  25. }
  26. /*---------------------------------*/
  27. /* 3. Prevent Overlap with Content */
  28. #navigator-toolbox {
  29. padding-top: 40px !important; /* Match toolbar height */
  30. }
  31.  
  32.  
  33. /*---------------------------------*/
  34. /* Move Window Buttons to Dedicated Toolbar */
  35. #titlebar-buttonbox-container {
  36. position: fixed !important;
  37. top: 0 !important;
  38. right: 0 !important; /* macOS uses right-aligned buttons */
  39. height: 40px !important; /* Match macOS traffic light buttons */
  40. padding: 8px 12px !important; /* Spacing around buttons */
  41. background: var(--toolbar-bgcolor) !important;
  42. z-index: 9999 !important; /* Ensure buttons stay above other elements */
  43. -moz-window-dragging: no-drag !important; /* Allow clicking */
  44. display: flex !important; /* Proper button alignment */
  45. }
  46.  
  47. /* Hide buttons in the tab bar */
  48. #TabsToolbar .titlebar-button {
  49. display: none !important;
  50. }
  51.  
  52. /*---------------------------------*/
  53. /* Move Window Buttons to Dedicated Toolbar */
  54. #titlebar-buttonbox-container {
  55. position: fixed !important;
  56. top: 0 !important;
  57. right: 0 !important; /* macOS uses right-aligned buttons */
  58. height: 40px !important; /* Match macOS traffic light buttons */
  59. padding: 8px 12px !important; /* Spacing around buttons */
  60. background: var(--toolbar-bgcolor) !important;
  61. z-index: 9999 !important; /* Ensure buttons stay above other elements */
  62. -moz-window-dragging: no-drag !important; /* Allow clicking */
  63. display: flex !important; /* Proper button alignment */
  64. }
  65.  
  66. /* Hide default buttons in the tab bar */
  67. #TabsToolbar .titlebar-button {
  68. display: none !important;
  69. }
  70.  
  71. /* Create space for the new toolbar */
  72. #navigator-toolbox {
  73. padding-top: 40px !important; /* Match toolbar height */
  74. }
  75.  
  76.  
  77.  
  78. /* Modify these values to match your preferences
  79. These reserve extra space on both sides of the nav-bar to be able to drag the window */
  80. :root:is([tabsintitlebar], [sizemode="fullscreen"]) {
  81. --uc-window-drag-space-pre: 30px; /* left side*/
  82. --uc-window-drag-space-post: 30px; /* right side*/
  83. }
  84.  
  85. :root:is([tabsintitlebar][sizemode="maximized"], [sizemode="fullscreen"]) {
  86. --uc-window-drag-space-pre: 0px; /* Remove pre space */
  87. }
  88.  
  89. /* Default width - used on Windows10+ */
  90. :root:is([tabsintitlebar], [sizemode="fullscreen"]) {
  91. --uc-window-control-width: 138px;
  92. }
  93.  
  94. @media (-moz-platform: windows-win7),
  95. (-moz-platform: windows-win8){
  96. :root:is([tabsintitlebar], [sizemode="fullscreen"]) {
  97. --uc-window-control-width: 105px;
  98. }
  99. }
  100. /* On linux set width based on number of caption buttons.
  101. One button */
  102. @media (-moz-gtk-csd-minimize-button), (-moz-gtk-csd-maximize-button), (-moz-gtk-csd-close-button) {
  103. :root:is([tabsintitlebar],[sizemode="fullscreen"]) {
  104. --uc-window-control-width: 28px;
  105. }
  106. }
  107. /* Two buttons */
  108. @media (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-maximize-button),
  109. (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-close-button),
  110. (-moz-gtk-csd-maximize-button) and (-moz-gtk-csd-close-button) {
  111. :root:is([tabsintitlebar],[sizemode="fullscreen"]) {
  112. --uc-window-control-width: 56px;
  113. }
  114. }
  115. /* Three buttons */
  116. @media (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-maximize-button) and (-moz-gtk-csd-close-button) {
  117. :root:is([tabsintitlebar],[sizemode="fullscreen"]) {
  118. --uc-window-control-width: 84px;
  119. }
  120. }
  121.  
  122.  
  123.  
  124. @media (-moz-platform: macos){
  125. :root:is([tabsintitlebar]) {
  126. --uc-window-control-width: 72px;
  127. }
  128. :root:is([tabsintitlebar][sizemode="fullscreen"]) {
  129. --uc-window-control-width: 0;
  130. }
  131. }
  132.  
  133. .titlebar-buttonbox{ color: var(--toolbar-color) }
  134. :root[sizemode="fullscreen"] .titlebar-buttonbox-container{ display: none }
  135.  
  136. :root[sizemode="fullscreen"] #TabsToolbar > .titlebar-buttonbox-container:last-child{
  137. position: absolute;
  138. display: flex;
  139. top: 0;
  140. right:0;
  141. height: 40px;
  142. }
  143.  
  144. :root[sizemode="fullscreen"] #TabsToolbar > .titlebar-buttonbox-container:last-child{ height: 32px }
  145.  
  146. #nav-bar{
  147. border-inline: var(--uc-window-drag-space-pre,0px) solid transparent;
  148. border-inline-style: solid !important;
  149. border-right-width: calc(var(--uc-window-control-width,0px) + var(--uc-window-drag-space-post,0px));
  150. background-clip: border-box !important;
  151. }
  152.  
  153.  
  154. /* Rules for window controls on left layout */
  155. @media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled"),
  156. (-moz-gtk-csd-reversed-placement),
  157. (-moz-platform: macos){
  158. :root[tabsintitlebar="true"] #nav-bar{
  159. border-inline-width: calc(var(--uc-window-control-width,0px) + var(--uc-window-drag-space-post,0px)) var(--uc-window-drag-space-pre,0px)
  160. }
  161. :root[sizemode="fullscreen"] #TabsToolbar > .titlebar-buttonbox-container:last-child{ right: unset }
  162. }
  163. @media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled"){
  164. .titlebar-buttonbox-container{
  165. order: -1 !important;
  166. }
  167. .titlebar-buttonbox{
  168. flex-direction: row-reverse;
  169. }
  170. }
  171.  
  172. #toolbar-menubar[autohide="true"] > .titlebar-buttonbox-container,
  173. #TabsToolbar > .titlebar-buttonbox-container{
  174. position: fixed;
  175. display: block;
  176. top: -10px;
  177. right:0;
  178. height: 40px;
  179. }
  180. @media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled"),
  181. (-moz-gtk-csd-reversed-placement),
  182. (-moz-platform: macos){
  183. .titlebar-buttonbox-container{ left:0; right: unset !important; }
  184. }
  185.  
  186. :root[uidensity="compact"] #TabsToolbar > .titlebar-buttonbox-container{ height: 32px }
  187.  
  188. #toolbar-menubar[inactive] > .titlebar-buttonbox-container{ opacity: 0 }
  189.  
  190. .titlebar-buttonbox-container > .titlebar-buttonbox{ height: 100%; }
  191.  
  192. #titlebar{
  193. order: 2;
  194. -moz-appearance: none !important;
  195. --tabs-navbar-shadow-size: 0px;
  196. --uc-menubar-vertical-overlap: 19px; /* for hide_tabs_with_one_tab_w_window_controls.css compatibility */
  197. }
  198.  
  199. #TabsToolbar .titlebar-spacer{ display: none; }
  200. /* Also hide the toolbox bottom border which isn't at bottom with this setup */
  201. #navigator-toolbox::after{ display: none !important; }
  202.  
  203. @media (-moz-gtk-csd-close-button){
  204. .titlebar-button{
  205. flex-direction: column;
  206. }
  207. }
  208.  
  209.  
  210.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement