Advertisement
Guest User

Untitled

a guest
May 2nd, 2025
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.77 KB | None | 0 0
  1. /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_bookmarks_and_main_toolbars.css made available under Mozilla Public License v. 2.0
  2. See the above repository for updates as well as full license text. */
  3.  
  4. #navigator-toolbox{
  5. --uc-bm-padding: 4px; /* Vertical padding to be applied to bookmarks */
  6. --uc-bm-height: calc(20px + 2 * var(--uc-bm-padding)); /* Might need to adjust if the toolbar has other buttons */
  7. --uc-navbar-height: -40px; /* navbar is main toolbar. Use negative value */
  8. --uc-autohide-toolbar-delay: 600ms; /* The toolbar is hidden after 0.6s */
  9. --uc-toolbox-browser-area-overlap: -1px;
  10. }
  11. :root[uidensity="compact"] #navigator-toolbox{
  12. --uc-navbar-height: -34px;
  13. }
  14. :root[uidensity="touch"] #navigator-toolbox{ --uc-bm-padding: 6px }
  15.  
  16. :root[chromehidden~="directories"] #navigator-toolbox{
  17. --uc-bm-height: 0px;
  18. }
  19. :root[chromehidden~="toolbar"] #navigator-toolbox{
  20. --uc-navbar-height: 0px;
  21. }
  22. /* At least on Windows 10 display scaling > 100% causes 1px gap to appear below tabs depending on Firefox
  23. * density settings and whether or not menubar is enabled.
  24. */
  25. @media (min-resolution: 120dpi){
  26. :root[uidensity="compact"] #navigator-toolbox:has(> #toolbar-menubar[autohide="false"]){
  27. --uc-toolbox-browser-area-overlap: -0.5px;
  28. }
  29. }
  30. @media (min-resolution: 140dpi){
  31. #navigator-toolbox{
  32. --uc-toolbox-browser-area-overlap: -0.5px;
  33. }
  34. }
  35.  
  36. #navigator-toolbox,
  37. #sidebar-box,
  38. #sidebar-main,
  39. #sidebar-splitter,
  40. #tabbrowser-tabbox{
  41. z-index: auto !important;
  42. }
  43.  
  44. :root[sessionrestored] #nav-bar,
  45. :root[sessionrestored] #PersonalToolbar{
  46. background-image: linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)), var(--lwt-additional-images,var(--toolbar-bgimage)) !important;
  47. background-position: top,var(--lwt-background-alignment);
  48. background-position-y: calc(0px - var(--tab-min-height) - 2*var(--tab-block-margin,0px));
  49. background-repeat: repeat,var(--lwt-background-tiling);
  50. transform: rotateX(90deg);
  51. transform-origin: top;
  52. transition: transform 135ms linear var(--uc-autohide-toolbar-delay) !important;
  53. z-index: 2;
  54. }
  55. #PlacesToolbarItems > .bookmark-item,
  56. #OtherBookmarks,
  57. #PersonalToolbar > #import-button{
  58. padding-block: var(--uc-bm-padding) !important;
  59. }
  60. :root[sessionrestored] #PersonalToolbar{
  61. z-index: 1;
  62. background-position-y: calc(0px - var(--tab-min-height) - 2*var(--tab-block-margin,0px) + var( --uc-navbar-height));
  63. }
  64.  
  65. :root[lwtheme-image] #nav-bar,
  66. :root[lwtheme-image] #PersonalToolbar{
  67. background-image: linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)),var(--lwt-header-image), var(--lwt-additional-images,var(--toolbar-bgimage)) !important;
  68. }
  69.  
  70. #nav-bar[customizing],#PersonalToolbar[customizing]{ transform: none !important }
  71.  
  72. #navigator-toolbox > #PersonalToolbar{
  73. transform-origin: 0px var(--uc-navbar-height);
  74. position: relative;
  75. }
  76. :root[sessionrestored] #urlbar[popover]{
  77. opacity: 0;
  78. pointer-events: none;
  79. transition: transform 135ms linear var(--uc-autohide-toolbar-delay), opacity 0ms calc(var(--uc-autohide-toolbar-delay) + 135ms);
  80. transform-origin: 0px calc((var(--urlbar-container-height) - var(--urlbar-height)) / 2);
  81. transform: rotateX(89.5deg);
  82. }
  83. #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#selection-shortcut-action-panel,#chat-shortcuts-options-panel,#tab-preview-panel)) ~ toolbox #urlbar[popover],
  84. #navigator-toolbox:is(:hover,:focus-within) #urlbar[popover],
  85. #urlbar-container > #urlbar[popover]:is([focused],[open]){
  86. opacity: 1;
  87. pointer-events: auto;
  88. transition-delay: 100ms;
  89. transform: rotateX(0deg);
  90. }
  91.  
  92. :root[sessionrestored]:not([customizing]) #navigator-toolbox{
  93. margin-bottom: calc(var(--uc-toolbox-browser-area-overlap,0px) - var(--uc-bm-height) + var(--uc-navbar-height));
  94. }
  95.  
  96. /* Make sure the bookmarks toolbar is never collapsed even if it is disabled */
  97. :root[sizemode="fullscreen"] #PersonalToolbar,
  98. #PersonalToolbar[collapsed="true"]{
  99. min-height: initial !important;
  100. max-height: initial !important;
  101. visibility: hidden !important
  102. }
  103. #PersonalToolbar[collapsed="true"] #PlacesToolbarItems > *,
  104. :root[sizemode="fullscreen"] #PersonalToolbar #PlacesToolbarItems > *{
  105. visibility: hidden !important;
  106. }
  107.  
  108. /* If bookmarks toolbar is collapsed on startup, then no items are generated, and we need to set some height for it */
  109. #PlacesToolbarItems:empty{
  110. height: var(--uc-bm-height);
  111. }
  112.  
  113. /* Selected tab needs higher z-index now to "hide" the broder below it */
  114. .tabbrowser-tab[selected]{ z-index: 3 !important; }
  115.  
  116. /* SELECT TOOLBAR BEHAVIOR */
  117. /* Comment out or delete one of these to disable that behavior */
  118.  
  119. /* Show when urlbar is focused */
  120. #nav-bar:focus-within + #PersonalToolbar,
  121. #navigator-toolbox > #nav-bar:focus-within{
  122. transition-delay: 100ms !important;
  123. transform: rotateX(0);
  124. }
  125.  
  126. /* Show when cursor is over the toolbar area or when some menu panel is open */
  127. #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#selection-shortcut-action-panel,#chat-shortcuts-options-panel,#tab-preview-panel)) ~ #navigator-toolbox > :is(#nav-bar,#PersonalToolbar),
  128. #navigator-toolbox:hover > :is(#nav-bar,#PersonalToolbar){
  129. transition-delay: 100ms !important;
  130. transform: rotateX(0);
  131. }
  132.  
  133. /* This makes the tab notification box show immediately below tabs, otherwise it would break the layout */
  134. #navigator-toolbox > div{ display: contents }
  135. :where(#titlebar,#navigator-toolbox > #TabsToolbar,#navigator-toolbox > #toolbar-menubar,#tab-notification-deck,.global-notificationbox){
  136. order: -1;
  137. }
  138. :root[BookmarksToolbarOverlapsBrowser] #navigator-toolbox{
  139. margin-bottom: calc(-1px - var(--uc-bm-height) + var(--uc-navbar-height)) !important;
  140. z-index: auto !important;
  141. }
  142. @media (-moz-bool-pref: "browser.fullscreen.autohide"),
  143. -moz-pref("browser.fullscreen.autohide"){
  144. :root[sizemode="fullscreen"] #navigator-toolbox[style*="margin-top"]{
  145. margin-top: calc(1px - var(--tab-min-height) - 2 * var(--tab-block-margin)) !important;
  146. }
  147. }
  148.  
  149. /* Set the following pref to enable compatibility with multi-row_bookmarks.css */
  150. @media (-moz-bool-pref: "userchrome.autohide-bm-and-main-toolbars.multirow-bookmarks-compat.enabled"),
  151. -moz-pref("userchrome.autohide-bm-and-main-toolbars.multirow-bookmarks-compat.enabled"){
  152. #navigator-toolbox{ margin-bottom: var(--uc-navbar-height) !important; }
  153. #PersonalToolbar:not([customizing]){
  154. min-height: 0 !important;
  155. margin-bottom: 0;
  156. height: 0;
  157. overflow-y: visible !important;
  158. z-index: 2;
  159. padding-inline: 0 !important;
  160. }
  161. #personal-bookmarks{
  162. background: inherit;
  163. height: min-content;
  164. }
  165. #PlacesToolbarDropIndicatorHolder{
  166. pointer-events: none !important;
  167. }
  168. }
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180. #forward-button, #back-button {
  181. display: none !important;
  182. }
  183.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement