CLHowell

Sidebery Expand-On-Hover

Mar 7th, 2026
719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 6.27 KB | Source Code | 0 0
  1. /* Sidebery Expand-On-Hover
  2.  * designed to both mimic and replace the native Firefox sidebar when vertical tabs and and expand-on-hover are enabled
  3.  * A few minor size tweaks as well because in my opinion the default icons are a bit too small in both native Firefox and Sidebery. Adjust to taste
  4.  * NOTE: Not very dynamic, edit CSS to make it look how you want. Especially --sidebar-expanded-width, as the bar used to drag the sidebar size has been removed
  5.  * (also I know my formatting isn't the most space-efficient. I like my brackets and indents ok? leave me alone) */
  6.  
  7. /* ________________________________________________________________ */
  8.  
  9. /* Add the following to your userChrome.css */
  10.  
  11. #main-window
  12. {
  13.     --sidebar-collapsed-width: 40px; /* personal preference, to match urlbar size. To match Firefox's native sidebar exactly, use 51.2333px */
  14.     --sidebar-expanded-width: 380px;
  15. }
  16.  
  17. #sidebar-panel-header
  18. {
  19.     display: none !important;
  20. }
  21.  
  22. #sidebar-main
  23. {
  24.     display: none !important;
  25. }
  26.  
  27. #sidebar-splitter
  28. {
  29.     display: none !important;
  30. }
  31.  
  32. #sidebar-launcher-splitter
  33. {
  34.     display: none !important;
  35. }
  36.  
  37. #sidebar-box
  38. {
  39.     width: var(--sidebar-collapsed-width) !important;
  40.     min-width: unset !important;
  41.     max-width: var(--sidebar-expanded-width) !important;
  42.     height: 100% !important;
  43.     padding-bottom: 0 !important;
  44.     z-index: 4 !important;
  45.     transition: width 0.33s cubic-bezier(0.07, 0.95, 0, 1) !important; /* Delete this line if you are using the adaptive tab bar colour fix below! */
  46. }
  47.  
  48. #sidebar-box:hover
  49. {
  50.     --tabs-lvl-opacity: 0.09 !important;
  51.     --tabs-indent: 16px !important;
  52.     width: var(--sidebar-expanded-width) !important;
  53. }
  54.  
  55. #sidebar-box:hover ~ #tabbrowser-tabbox
  56. {
  57.     margin-left: calc( (var(--sidebar-expanded-width) - var(--sidebar-collapsed-width)) * -1) !important;
  58. }
  59.  
  60. #tabbrowser-tabbox
  61. {
  62.     z-index: inherit !important;
  63.     transition: margin-left 0.33s cubic-bezier(0.07, 0.95, 0, 1) !important;
  64. }
  65.  
  66. /* If you are using the excellent Adaptive Tab Bar Colour extension along with Sidebery, and have employed this fix: https://github.com/easonwong-de/Adaptive-Tab-Bar-Colour?tab=readme-ov-file#customising-colour-transitions
  67.  * then you need to edit that fix to resemble below:
  68.  
  69. #navigator-toolbox, #TabsToolbar, #nav-bar, #PersonalToolbar, #sidebar-box, .tab-background, .urlbar-background, findbar
  70. {
  71.     transition:
  72.         background-color 0.5s cubic-bezier(0, 0, 0, 1),
  73.         border-color 0.5s cubic-bezier(0, 0, 0, 1),
  74.         width 0.33s cubic-bezier(0.07, 0.95, 0, 1) !important;
  75. }
  76.  * then delete line 45 <<<<<<<<<<<<<<<<<<<<<<
  77.  
  78.  * Other niceties for integration with Adaptive Tab Bar Colour:
  79.  
  80. .browserContainer
  81. {
  82.     box-shadow: none !important;
  83. }
  84.  
  85. *
  86. {
  87.     border: none !important;
  88.     scrollbar-color: transparent;
  89. }
  90. */
  91.  
  92. /* ________________________________________________________________ */
  93.  
  94. /* Add the following to the Styles editor in your Sidebery settings */
  95.  
  96. .Tab
  97. {
  98.     margin-left: 4px; /* Best for the --sidebar-collapsed-width being 40px. If you changed it to a different value, update the margins to your preference */
  99.     transition: all 0.33s cubic-bezier(0.07, 0.95, 0, 1);
  100. }
  101.  
  102. .Tab .fav-icon
  103. {
  104.     left: -2px;
  105. }
  106.  
  107. /* If you are using the 40px --sidebar-collapsed-width that I have by default here, I recommend the below. The speaker icon on a tab that's currently playing audio will be cut off otherwise
  108.  
  109. .Tab .audio
  110. {
  111.     top: 16px !important;
  112.     left: 16px !important;
  113.     width: 20px !important;
  114.     height: 20px !important;
  115.     background-color: var(--frame-bg); * you could also keep this transparent but in my opinion it flows better when it clips the logo behind it, especailly with Adaptive Tab Bar Colour and against white logos
  116.     clip-path: circle();
  117.     overflow: visible;
  118. }
  119.  
  120.  * If you keep the above background-color instead of keeping it transparent, the below will give the audio icon a nice little border that is offset in the direction of the main icon (on the current tab only)
  121.  
  122. .Tab[data-active="true"] .audio::before
  123. {
  124.         content: "";
  125.         width: 100%;
  126.         height: 100%;
  127.         Display: block;
  128.         background: transparent;
  129.         border-radius: 999px;
  130.         border: 1px solid;
  131.         border-color: rgba(255,255,255.133); * matches Sidebery's default border around the active tab. Change if you have the Tabs - Activated Shadow Syle setting in Siebery set to "on"
  132. }
  133. */
  134.  
  135. div.bottom-bar-space
  136. {
  137.     transition: height 0.33s cubic-bezier(0.07, 0.95, 0, 1);
  138. }
  139.  
  140. #root:not(:hover)
  141. {
  142.     --tabs-indent: 0px;
  143.     --tabs-lvl-opacity: 0;
  144.  
  145.     .Tab .body
  146.     {
  147.         width: 32px;
  148.     }
  149.  
  150.     .Tab .title
  151.     {
  152.         display: none;
  153.     }
  154.  
  155.     div.new-tab-btn
  156.     {
  157.         display: none;
  158.     }
  159.  
  160.     div.tool-btn
  161.     {
  162.         display: none;
  163.     }
  164.  
  165.     div.bottom-bar-space
  166.     {
  167.         height: 1px !important;
  168.     }
  169. }
  170.  
  171. /* Another Adaptive Tab Bar Colour recommendation */
  172.  
  173. .Sidebar, .bottom-space
  174. {
  175.     transition: background-color 0.5s cubic-bezier(0, 0, 0, 1) !important;
  176. }
  177.  
  178. /* Other tweaks that I personally made but aren't necessary to make things work. All in the Styles editor in your Sidebery settings
  179.  
  180.  * Larger icons. Best with a larger --general-margin. I used 8px
  181.  
  182. .Tab .fav
  183. {
  184.     position:relative;
  185.     width:16px;
  186.     height:32px;
  187.     flex-shrink:0;
  188.     opacity:1;
  189.     z-index:10;
  190.     transform:translateZ(0);
  191. }
  192.  
  193. .Tab .fav-icon
  194. {
  195.     position:absolute;
  196.     top:4px;
  197.     left:-6px;
  198.     width:24px;
  199.     height:24px;
  200.     fill:var(--tabs-normal-fg);
  201.     transition:opacity var(--d-fast);
  202. }
  203.  
  204.  * Since I made the icons so big, some more square-ish website logos hit the corners of the bounds of the tab, so I clipped them like so:
  205.  
  206. .Tab .fav
  207. {
  208.     clip-path: circle() !important;
  209. }
  210.  
  211. .Tab img.fav-icon
  212. {
  213.     clip-path: circle() !important;
  214. }
  215.  
  216.  * This does crop the content off of some logos, so just don't add the above if you don't want that feature. Or make the icons smaller than I did
  217.  
  218.  
  219.  * A very slight adjustment that makes the indent markings for the tabs tree line up more nicely with the tab that they are indenting (in my opinion):
  220.  
  221.  .Tab .body::after {
  222.   content: "";
  223.   position: absolute;
  224.   display: none;
  225.   top: calc( var(--tabs-margin) * -1);
  226.   left: calc(var(--tabs-indent) / -2);
  227.   width: 1px;
  228.   height: calc(var(--tabs-height) + var(--tabs-margin));
  229.   opacity: var(--tabs-lvl-opacity);
  230.   background-color: var(--tabs-normal-fg);
  231. }
  232.  
  233. */
Advertisement
Add Comment
Please, Sign In to add comment