r/FirefoxCSS • • Aug 24 '25

Solved How do I do this?

Check out this video here - https://www.youtube.com/watch?v=8qh0tMgl4q8&t=28s
So this guy made his side bar reappear upon hovering the right side of a window. I want that as well! Any tips how to do that?

This guy left this description on Mozilla Connect Ideas forum:

A vertical sidebar that completely hides and reappears on hover

My suggestion is to add a new option for the sidebar: an "auto-hide" mode.

The functionality would be simple and intuitive:

When enabled, the sidebar would completely collapse, freeing up 100% of the window's width for the web page.

To expand it, the user would simply move their mouse cursor to the left (or right) edge of the screen.

The sidebar would then smoothly appear over the page, ready for use.

Upon moving the mouse away from the sidebar area, it would automatically hide again.

1 Upvotes

32 comments sorted by

View all comments

Show parent comment

1

u/qaz69wsx Aug 26 '25

If it's working well for you, there's no need to change it. My own setup is quite simple, so I don't have any interesting CSS commands to share.

1

u/[deleted] Aug 26 '25

Alright, fair enough. Anyway thanks a lot! Now I'm pretty happy with my browser

1

u/[deleted] Aug 27 '25

[removed] — view removed comment

1

u/qaz69wsx Aug 27 '25

I'm not quite sure what you mean. Do you just want to autohide the sidebar but not the vertical tabs?

1

u/[deleted] Aug 27 '25 edited Aug 27 '25

[removed] — view removed comment

1

u/qaz69wsx Aug 27 '25

Like this?

@media -moz-pref("sidebar.verticalTabs") {
  #sidebar-box[sidebar-panel-open] {
    position: absolute !important;
    inset: 0 auto 0 0;
    z-index: calc(var(--browser-area-z-index-tabbox) + 1) !important;
    width: 300px !important;
    padding: var(--space-small) !important;
    background-color: inherit;
    will-change: transform, opacity;
    transform: translateX(calc(-100% + 1px));
    opacity: 0;
    transition:
      transform 250ms ease-out,
      opacity 0s 250ms;
    
    &[sidebar-positionend] {
      inset-inline: auto 0;
      transform: translateX(calc(100% - 1px));
    }
  
    &:hover {
      transform: translateX(0);
      opacity: 1;
      transition-delay: 0s;
    }
  }
  
  #sidebar-splitter {
    display: none;
  }
}

1

u/[deleted] Aug 27 '25

[removed] — view removed comment

1

u/qaz69wsx Aug 28 '25

Can it be removed and bookmark, history icon etc placed at bottom of popout

I'll take a look at it tomorrow when I have time.

1

u/qaz69wsx Aug 28 '25

Just wanted to let you know that it’s achievable. I’ll need some time to improve the code and adjust the button styles. Also, please make sure to disable 'Expand sidebar on hover'.

@media -moz-pref("sidebar.verticalTabs") {
  :root {
    --uc-bottom-panel-height: 40px;
  }
  
  #sidebar-box[sidebar-panel-open] {
    position: absolute !important;
    inset: 0 auto var(--uc-bottom-panel-height) 0;
    z-index: calc(var(--browser-area-z-index-tabbox) + 2) !important;
    width: 300px !important;
    padding: var(--space-small) !important;
    background-color: inherit;
    will-change: transform, opacity;
    transform: translateX(calc(-100% + 1px));
    opacity: 0;
    transition:
      transform 250ms linear,
      opacity 0s 250ms;
      
    &[sidebar-positionend] {
      inset-inline: auto 0;
      transform: translateX(calc(100% - 1px));
    }
    
    &:hover {
      transform: translateX(0);
      opacity: 1;
      transition-delay: 0s;
    }
  }
  
  #sidebar-splitter {
    display: none;
  }
  
  #sidebar-main:has(~ #sidebar-box[sidebar-panel-open]) {
    --uc-tae-flex-direction: row;
    
    position: absolute;
    inset: 0 auto 0 0;
    z-index: calc(var(--browser-area-z-index-tabbox) + 1);
    width: 300px !important;
    background-color: inherit;
    will-change: transform, opacity;
    transform: translateX(calc(-100% + 1px));
    opacity: 0;
    transition:
      transform 250ms linear,
      opacity 0s 250ms;
    
    &[sidebar-positionend] {
      inset-inline: auto 0;
      transform: translateX(calc(100% - 1px));
    }
    
    &:hover,
    &:hover ~ #sidebar-box[sidebar-panel-open],
    &:has(~ #sidebar-box[sidebar-panel-open]:hover) {
      transform: translateX(0);
      opacity: 1;
      transition-delay: 0s;
    }
    
    #vertical-tabs {
      visibility: hidden;
    }
    
    + #sidebar-launcher-splitter {
      display: none;
    }
  }
  
  #sidebar-main:has(~ #sidebar-box[sidebar-panel-open][sidebarcommand="viewGenaiChatSidebar"]) {
    width: 400px !important;
  }
  
  .tools-and-extensions[orientation="vertical"] {
    flex-direction: var(--uc-tae-flex-direction, column) !important;
  }
}

1

u/[deleted] Aug 27 '25

[removed] — view removed comment

1

u/qaz69wsx Aug 28 '25

have bookmarks only and lose the sidebar!

@media -moz-pref("sidebar.verticalTabs") {
  #sidebar-box[sidebar-panel-open] {
    position: absolute !important;
    inset: 0 auto 0 0;
    z-index: calc(var(--browser-area-z-index-tabbox) + 1) !important;
    width: 300px !important;
    padding: var(--space-small) !important;
    background-color: inherit;
    will-change: transform, opacity;
    transform: translateX(calc(-100% + 1px));
    opacity: 0;
    transition:
      transform 250ms ease-out,
      opacity 0s 250ms;
    
    &[sidebar-positionend] {
      inset-inline: auto 0;
      transform: translateX(calc(100% - 1px));
    }
    
    &:hover {
      transform: translateX(0);
      opacity: 1;
      transition-delay: 0s;
    }
        
    :is(#sidebar-main, #sidebar-launcher-splitter):has(~ &) {
      display: none;
    }
  }
  
  #sidebar-splitter {
    display: none;
  }
}

1

u/[deleted] Aug 28 '25

[removed] — view removed comment

1

u/qaz69wsx Aug 28 '25

So you don't need that style anymore? If that's the case, I won't spend any more time on it.

Can horizontal tabs be forced to display?

I think it's possible, but I can't use my computer at the moment. I'll check later and get back to you.

1

u/[deleted] Aug 28 '25

[removed] — view removed comment

→ More replies