zzaaasa

userChrome.css

Jul 12th, 2025
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.63 KB | None | 0 0
  1. /* Style the main sidebar content */
  2. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] #sidebar,
  3. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] .sidebar-browser-stack {
  4. border-radius: 12px !important;
  5. overflow: hidden !important;
  6. background: var(--toolbar-bgcolor) !important;
  7. border: 1px solid var(--chrome-content-separator-color) !important;
  8. }
  9.  
  10. /* Remove the header if you want it even cleaner */
  11. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] #sidebar-header {
  12. display: none !important;
  13. }
  14.  
  15. /* Add subtle shadow for depth */
  16. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"]:hover {
  17. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  18. }
  19.  
  20. /* Improve the hover area */
  21. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"]::before {
  22. content: "";
  23. position: absolute;
  24. left: -5px;
  25. top: 0;
  26. width: 15px;
  27. height: 100%;
  28. z-index: 999;
  29. pointer-events: auto;
  30. border-radius: 12px 0 0 12px;
  31. }
  32.  
  33. /* Firefox 133+ Compatibility Fix - Add this to the TOP of your userChrome.css */
  34.  
  35. /* Force sidebar to respect the autohide behavior */
  36. #sidebar-box {
  37. position: fixed !important;
  38. z-index: 1000 !important;
  39. left: 0 !important;
  40. top: var(--tab-min-height, 33px) !important; /* Start below the tab bar */
  41. height: calc(100vh - var(--tab-min-height, 33px)) !important; /* Adjust height accordingly */
  42. margin: 0 !important;
  43. padding: 0 !important;
  44. }
  45.  
  46. /* Alternative approach - uses relative positioning instead of fixed */
  47. /* Try this if the fixed positioning causes issues */
  48. /*
  49. #sidebar-box {
  50. position: relative !important;
  51. z-index: 1000 !important;
  52. margin-top: 0 !important;
  53. margin-left: 0 !important;
  54. padding: 0 !important;
  55. }
  56.  
  57. #browser {
  58. position: relative !important;
  59. }
  60.  
  61. #sidebar-box {
  62. position: absolute !important;
  63. left: 0 !important;
  64. top: 0 !important;
  65. height: 100% !important;
  66. z-index: 999 !important;
  67. }
  68. */
  69.  
  70. /* Ensure the sidebar container behaves correctly */
  71. #sidebar-box .sidebar-browser-stack {
  72. width: var(--uc-sidebar-width, 0px) !important;
  73. transition: width var(--uc-autohide-transition-duration, 115ms) var(--uc-autohide-transition-type, linear) var(--uc-autohide-sidebar-delay, 600ms) !important;
  74. }
  75.  
  76. #sidebar-box:hover .sidebar-browser-stack {
  77. width: var(--uc-sidebar-hover-width, 280px) !important;
  78. transition-delay: 0ms !important;
  79. }
  80.  
  81. /* Fix for Sidebery specifically */
  82. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] .sidebar-browser-stack {
  83. overflow: hidden !important;
  84. }
  85.  
  86. /* Alternative approach - try this if the above doesn't work */
  87. /* Replace your existing CSS variables section with this: */
  88. /*
  89. :where(#main-window) #browser{
  90. --uc-sidebar-width: 1px !important;
  91. --uc-sidebar-hover-width: 280px !important;
  92. }
  93.  
  94. #sidebar-box {
  95. width: var(--uc-sidebar-width) !important;
  96. min-width: var(--uc-sidebar-width) !important;
  97. max-width: var(--uc-sidebar-width) !important;
  98. overflow: visible !important;
  99. position: relative !important;
  100. transition: all 0.2s ease !important;
  101. }
  102.  
  103. #sidebar-box:hover {
  104. width: var(--uc-sidebar-hover-width) !important;
  105. min-width: var(--uc-sidebar-hover-width) !important;
  106. max-width: var(--uc-sidebar-hover-width) !important;
  107. }
  108. */
  109.  
  110. /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_sidebar.css made available under Mozilla Public License v. 2.0
  111. See the above repository for updates as well as full license text. */
  112.  
  113. /* Show sidebar only when the cursor is over it.
  114. The border controlling sidebar width will be removed so you'll need to modify
  115. these values to change width.
  116. By default the internal layout of sidebar changes when hovered, but this can
  117. be changed by setting pref "userchrome.autohide-sidebar.static-layout.enabled" to true
  118. */
  119.  
  120. /* Note: If you want only *some* sidebar to be auto-hidden, then you can use [sidebarcommand] attribute selector.
  121. For example, to only affect Sidebery's sidebar replace all instances of #sidebar-box with
  122. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"].
  123. To find the sidebarcommand value for any other sidebar, open that sidebar and use Browser Toolbox to inspect it.
  124. See: https://firefox-source-docs.mozilla.org/devtools-user/browser_toolbox/index.html
  125. */
  126. :where(#main-window) #browser{
  127. --uc-sidebar-width: 0px;
  128. --uc-sidebar-hover-width: 280px;
  129. }
  130. #main-window[sizemode="fullscreen"] #browser{
  131. --uc-sidebar-width: 1px;
  132. }
  133. #sidebar-box{
  134. --uc-autohide-sidebar-delay: 600ms; /* Wait 0.6s before hiding sidebar */
  135. --uc-autohide-transition-duration: 115ms;
  136. --uc-autohide-transition-type: linear;
  137. --browser-area-z-index-sidebar: 3;
  138. position: relative;
  139. min-width: var(--uc-sidebar-width) !important;
  140. width: var(--uc-sidebar-width) !important;
  141. max-width: var(--uc-sidebar-width) !important;
  142. z-index: var(--browser-area-z-index-sidebar,3);
  143. background-color: inherit;
  144. /* This directionality flipper is played so that sidebar "grows" into the right direction */
  145. direction: ltr;
  146. &:is([positionend],[sidebar-positionend]):not(:-moz-locale-dir(rtl)){
  147. direction: rtl;
  148. }
  149. }
  150. .sidebar-browser-stack{
  151. background: inherit;
  152. }
  153. #main-window[sizemode="fullscreen"] #browser{ --uc-sidebar-width: 1px; }
  154.  
  155. #sidebar-splitter{ display: none }
  156.  
  157. #sidebar-header{
  158. overflow: hidden;
  159. color: var(--chrome-color, inherit) !important;
  160. padding-inline: 0 !important;
  161. }
  162.  
  163. #sidebar-header::before,
  164. #sidebar-header::after{
  165. content: "";
  166. display: flex;
  167. padding-left: 8px;
  168. }
  169.  
  170. #sidebar-header,
  171. #sidebar{
  172. transition: min-width var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
  173. min-width: var(--uc-sidebar-width) !important;
  174. will-change: min-width;
  175. direction: ltr;
  176. &:-moz-locale-dir(rtl){
  177. direction: rtl;
  178. }
  179. }
  180. #sidebar-box:hover > #sidebar-header,
  181. #sidebar-box:hover > #sidebar,
  182. #sidebar-box:hover > .sidebar-browser-stack > #sidebar{
  183. min-width: var(--uc-sidebar-hover-width) !important;
  184. transition-delay: 0ms !important;
  185. }
  186.  
  187. .sidebar-panel{
  188. background-color: transparent !important;
  189. color: var(--newtab-text-primary-color) !important;
  190. }
  191.  
  192. .sidebar-panel #search-box{
  193. -moz-appearance: none !important;
  194. background-color: rgba(249,249,250,0.1) !important;
  195. color: inherit !important;
  196. }
  197.  
  198. /* Add sidebar divider and give it background */
  199.  
  200. #sidebar,
  201. #sidebar-header{
  202. background-color: inherit !important;
  203. border-inline: 1px solid rgb(80,80,80);
  204. border-inline-width: 0px 1px;
  205. }
  206.  
  207. #sidebar-box:not([positionend],[sidebar-positionend]) > :-moz-locale-dir(rtl),
  208. #sidebar-box:is([positionend],[sidebar-positionend]) > *{
  209. border-inline-width: 1px 0px;
  210. }
  211. @media -moz-pref("sidebar.revamp") {
  212. #sidebar, #sidebar-header{ border-style: none }
  213. #sidebar-box{ padding: 0 !important; }
  214. }
  215. /* Move statuspanel to the other side when sidebar is hovered so it doesn't get covered by sidebar */
  216.  
  217. #sidebar-box:not([positionend],[sidebar-positionend]):hover ~ #appcontent #statuspanel{
  218. inset-inline: auto 0px !important;
  219. }
  220. #sidebar-box:not([positionend],[sidebar-positionend]):hover ~ #appcontent #statuspanel-label{
  221. margin-inline: 0px !important;
  222. border-left-style: solid !important;
  223. }
  224. @media -moz-pref("userchrome.autohide-sidebar.static-layout.enabled"){
  225. #sidebar-box{
  226. min-width: var(--uc-sidebar-width) !important;
  227. contain: size;
  228. box-shadow: var(--content-area-shadow);
  229. }
  230. #sidebar{
  231. min-width: var(--uc-sidebar-hover-width) !important;
  232. }
  233. .sidebar-browser-stack{
  234. overflow: hidden;
  235. width: 100%;
  236. transition: width var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay);
  237. direction: ltr;
  238. &:hover{
  239. transition-delay: 0ms;
  240. width: var(--uc-sidebar-hover-width);
  241. }
  242. &:-moz-locale-dir(rtl){
  243. transition-property: transform,width !important;
  244. }
  245. }
  246. #sidebar-box[sidebar-positionend]:hover :is(#sidebar-header,#sidebar):-moz-locale-dir(ltr){
  247. transform: translateX(0);
  248. transition-delay: 0ms !important;
  249. }
  250. #sidebar-box:not([sidebar-positionend]):hover .sidebar-browser-stack:-moz-locale-dir(rtl){
  251. transform: translateX(calc(-1 * var(--uc-sidebar-hover-width) + var(--uc-sidebar-width)));
  252. }
  253. #sidebar-box[sidebar-positionend]:hover > .sidebar-browser-stack:-moz-locale-dir(rtl){
  254. transform: translateX(calc(var(--uc-sidebar-hover-width) - var(--uc-sidebar-width)));
  255. transition-delay: 0ms !important;
  256. }
  257. }
  258.  
  259. /**
  260. * Dynamic Horizontal Tabs Toolbar (with animations)
  261. * sidebar.verticalTabs: false (with native horizontal tabs)
  262. */
  263. #main-window #TabsToolbar > .toolbar-items {
  264. overflow: hidden;
  265. transition: height 0.3s 0.3s !important;
  266. }
  267. /* Default state: Set initial height to enable animation */
  268. #main-window #TabsToolbar > .toolbar-items { height: 3em !important; }
  269. #main-window[uidensity="touch"] #TabsToolbar > .toolbar-items { height: 3.35em !important; }
  270. #main-window[uidensity="compact"] #TabsToolbar > .toolbar-items { height: 2.7em !important; }
  271. /* Hidden state: Hide native tabs strip */
  272. #main-window[titlepreface*="XXX"] #TabsToolbar > .toolbar-items { height: 0 !important; }
  273. /* Hidden state: Fix z-index of active pinned tabs */
  274. #main-window[titlepreface*="XXX"] #tabbrowser-tabs { z-index: 0 !important; }
  275. /* Hidden state: Hide window buttons in tabs-toolbar */
  276. #main-window[titlepreface*="XXX"] #TabsToolbar .titlebar-spacer,
  277. #main-window[titlepreface*="XXX"] #TabsToolbar .titlebar-buttonbox-container {
  278. display: none !important;
  279. }
  280. /* [Optional] Uncomment block below to show window buttons in nav-bar (maybe, I didn't test it on non-linux-i3wm env) */
  281. /* #main-window[titlepreface*="XXX"] #nav-bar > .titlebar-buttonbox-container,
  282. #main-window[titlepreface*="XXX"] #nav-bar > .titlebar-buttonbox-container > .titlebar-buttonbox {
  283. display: flex !important;
  284. } */
  285. /* [Optional] Uncomment one of the line below if you need space near window buttons */
  286. /* #main-window[titlepreface*="XXX"] #nav-bar > .titlebar-spacer[type="pre-tabs"] { display: flex !important; } */
  287. /* #main-window[titlepreface*="XXX"] #nav-bar > .titlebar-spacer[type="post-tabs"] { display: flex !important; } */
  288.  
  289. /* Rounded corners specifically for Sidebery */
  290. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] {
  291. border-radius: 6px !important;
  292. margin: 2px 0px !important; /* Reduce margin and only apply top/bottom */
  293. overflow: visible !important;
  294. }
  295.  
  296. /* Add a hover trigger area */
  297. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"]::before {
  298. content: "";
  299. position: absolute;
  300. left: 0;
  301. top: 0;
  302. width: 10px; /* Invisible hover area extending from the edge */
  303. height: 100%;
  304. z-index: 999;
  305. pointer-events: auto;
  306. }
  307.  
  308. /* Target Sidebery's specific elements */
  309. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] #sidebar-header,
  310. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] #sidebar,
  311. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] .sidebar-browser-stack {
  312. border-radius: 6px !important;
  313. overflow: hidden !important;
  314. }
  315.  
  316. /* Alternative: Try targeting just the browser stack for Sidebery */
  317. #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] > .sidebar-browser-stack {
  318. border-radius: 6px !important;
  319. overflow: hidden !important;
  320. background: inherit !important;
  321. }
Advertisement
Add Comment
Please, Sign In to add comment