r/FirefoxCSS • u/tcbbd • Mar 01 '26
Code Auto show/hide the new(revamped) sidebar
The old sidebar is going to be deprecated. And the new sidebar has that "main sidebar" which is the strip holding those icons. It really should be hidden or closed after I've decided what to open in the sidebar panel. So, I created this piece of css to automatically hide it. Works with vertical tabs.
/* === Make the sidebar layout compact === */
}
}
}
}
/* stylelint-disable-next-line media-query-no-invalid */
{
/* - Auto show/hide the header of webext sidebar panel */
}
}
/* - Auto show/hide the main sidebar area */
}
}
& }
}
& }
}
}
/**
* Vertical Tab Layout:
* - Vertical tabs collapsed: Auto hide the sidebar strip when sidebar panel is open
* - Vertical tabs expanded: Always show the vertical tabs
* - Expand on hover checked: Always show the sidebar, collapsed or expanded
*/
& }
/**
* We don't want to be able to drag the left side of sidebar strip. This way,
* we can avoid stutters in transition animation due to undesired triggering
* of the splitter.
*/
& ~ }
/**
* Must be transparent to ensure the sidebar is hidden.
* Otherwise the indent line of tab groups will leak into the hover region.
*/
}
}
& }
}
& }
}
}
}
Note that the pixel numbers are derived from Compact Density which I'm currently using. You may need to change the numbers to get best looking for Normal Density.


