Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save liemlb/d4905d5c7fa13a839f8d5e419cbeb45d to your computer and use it in GitHub Desktop.
Save liemlb/d4905d5c7fa13a839f8d5e419cbeb45d to your computer and use it in GitHub Desktop.
Tree Style Tab: Sliding sidebar / pinned + active tabs

Firefox pretty sliding sidebar / pinned / active tab theme for Tree Style Tab

Features

  • Auto-sliding draw for TST
  • Leaves 'pinned' and 'active' tabs visible in standard browser chrome
  • Leaves 'last-active' tabs visible for 3 minutes after becoming inactive
  • Where an active tab is pinned, leaves 'last-active' tab (x1) visible for 1hr

tree-style-tabs-theme

Instructions

  1. Choose: (Hamburger menu) -> 'Customize' - Switch 'Title bar': off - also 'Drag space': off
  2. Browse to URL "about:config" - set toolkit.legacyUserProfileCustomizations.stylesheets: true
  3. Browse to URL "about:profiles" - Select 'Profile in use' -> 'Root Directory' -> 'Show in Finder' (Mac) - Save userChrome.css under ${Root Directory}/chrome/ (you may need to create this directory) - restart the browser
  4. Install Tree Style Tab
  5. Browse to URL: "about:addons" - Select 'Tree Style Tab' -> 'Preferences' tab -> 'Extra style rules for sidebar contents' - paste in the content from tree-style-tabs-theme.css
/* Hide border on tab bar, force its state to 'scroll', adjust margin-left for width of scrollbar. */
#tabbar {
border: 0;
scrollbar-width: none;
overflow: scroll !important;
margin-top: 0 !important;
}
/* Include 'reveal' animation ... stagers by level */
#tabbar .tab {
transition: 0.1s margin-top, 0.2s 0.1s margin-left, 0.2s 0.1s visibility;
}
/* delay transitions on open */
#tabbar:not(:hover) .tab {
transition-delay: 1s;
margin-left: 0;
}
/* animate twisty reveal */
#tabbar .tab .twisty {
transition: 0.2s margin;
}
/* general tabs */
.tab {
background-color: transparent;
}
.tab,
.tab.pinned {
height: 2.8em;
}
/* Push tab labels slightly to the right so they're completely hidden in collapsed state, but still look fine while expanded. */
.tab .label {
margin-left: 1em;
}
/* fix closebox */
.tab .closebox {
margin-left: 0;
}
.tab .counter {
margin-left: auto;
display: inline-block !important;
}
/* Hide .twisty and adjust margins so favicons have 7px on left. */
#tabbar:not(:hover) .tab .twisty {
visibility: hidden;
margin-left: -12px;
transition-delay: 1s;
}
/* hide closebox unless needed */
.tab:not(:hover) .closebox {
visibility: hidden;
}
/* Hide sound playing/muted button. */
.sound-button {
margin-left: 0;
display: inline-block;
visibility: collapse;
}
.tab.audible .sound-button {
visibility: visible;
margin-left: 0.25em;
}
.tab:not([data-child-ids]) .counter {
/* visibility: hidden; */
}
tab-item:not(.subtree-collapsed) .counter {
visibility: hidden;
}
/* Hide 'new tab' button. */
.newtab-button {
display: none;
}
/* active tab */
.tab.active {
background-color: rgba(255, 255, 255, 0.05) !important;
box-shadow: inset 3px 0 0 #ffffff99 !important;
}
.tab:hover,
.tab.active:hover {
background-color: inherit;
}
.tab.active .label {
font-weight: bold;
color: #f4f4f4 !important;
}
.tab .label,
.tab.active .label {
border-bottom: 1px solid transparent;
}
.tab:hover .label,
.tab.active:hover .label {
border-bottom: 1px dotted;
min-width: 0 !important;
flex-shrink: 1 !important;
flex-grow: unset !important;
}
/* pending / unloaded tabs */
.tab.discarded {
background-color: #1d1d1d;
}
.tab.discarded .label {
color: #efefefCC !important;
}
.tab.discarded:hover .label {
color: #efefef !important;
}
/* Adjust style for tab that has sound playing. */
.tab.sound-playing .favicon::after,
.tab.muted .favicon::after {
content: '🔊';
z-index: var(--favicon-base-z-index);
position: absolute;
font-size: 0.5em;
bottom: -0.35em;
right: -0.7em;
}
/* Adjust style for tab that is muted. */
.tab.muted .favicon::after {
content: '🔇';
}
/* Pinned tabs: */
/* Hide all non-active pinned tabs (these are included in top-bar instead) */
.tab.pinned {
position: relative;
max-width: none;
width: auto;
top: 0 !important;
left: 0 !important;
}
.tab.pinned:not(.active) {
display: none;
}
.tab.pinned .label {
display: block;
}
.tab.pinned .sound-button {
position: relative;
transform: none;
}
.tab.pinned .twisty {
display: block;
min-width: none;
width: auto;
}
/*
Firefox `userChrome.css` for Tree Style Tab
* Auto-sliding draw for TST
* Leaves 'pinned' and 'active' tabs visible in standard browser chrome
* Leaves 'last-active' tabs visible for 3 minutes after becoming inactive
* Where an active tab is pinned, leaves 'last-active' tab (x1) visible for 1hr
Instructions:
1. Choose: (Hamburger menu) -> 'Customize'
- Switch 'Title bar': off
- also 'Drag space': off
2. Browse to URL "about:config"
- set `toolkit.legacyUserProfileCustomizations.stylesheets`: true
3. Browse to URL "about:profiles"
- Select 'Profile in use' -> 'Root Directory' -> 'Show in Finder' (Mac)
- Save this file under `chrome/userChrome.css`
- restart the browser
4. Install Tree Style Tab
5. Browse to URL: "about:addons"
- Select 'Tree Style Tab' -> 'Preferences' tab -> 'Extra style rules for sidebar contents'
- paste in content from `tree-style-tabs-theme.css`
*/
/* where active tab is pinned, delays hiding of 'last-active' inactive tab for 1hr */
.tabbrowser-tab[pinned][selected] ~ .tabbrowser-tab:not([pinned]) {
transition-duration: 0s !important;
transition-property: width, visibility, min-width, -moz-box-flex !important;
transition-delay: 3600s !important; /* = 1hr, adjust seconds to increase / decrease visibility */
}
/* hides all non-active tabs */
.tabbrowser-tab:not([pinned]):not([selected]) {
visibility: hidden;
overflow: hidden;
min-width: 0 !important;
-moz-box-flex: 0 !important;
}
/* waits 60 seconds before hiding inactive tabs */
.tabbrowser-tab:not([pinned]) {
min-width: 0 !important;
transition-property: width, visibility !important;
transition-duration: 0.4s !important; /* slide shut */
transition-delay: 180s !important; /* wait X seconds before hiding inactive tabs | 0 = immediate */
}
/* shows active tabs immediately */
.tabbrowser-tab[selected]:not([pinned]) {
min-width: var(--tab-min-width) !important;
width: var(--tab-min-width) !important;
transition-duration: 0s !important; /* = immediate */
transition-delay: 0s !important; /* = immediate */
}
/* Sidebar sliding auto-reveal */
/* Sidebar min and max width removal */
#sidebar {
max-width: none !important;
min-width: 0px !important;
}
/* Hide splitter */
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] + #sidebar-splitter {
display: none !important;
}
/* Hide sidebar header */
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
visibility: collapse;
}
/* Shrink sidebar until hovered */
:root {
--thin-tab-width: 30px;
--wide-tab-width: 300px;
}
#sidebar-box:not([sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"]) {
min-width: var(--wide-tab-width) !important;
max-width: none !important;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] {
overflow: hidden !important;
position: relative !important;
transition: all 200ms 1s !important;
min-width: var(--thin-tab-width) !important;
max-width: var(--thin-tab-width) !important;
z-index: 2;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"]:hover,
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar {
transition-delay: 0s !important;
min-width: var(--wide-tab-width) !important;
max-width: var(--wide-tab-width) !important;
z-index: 1;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"]:hover {
margin-right: calc((var(--wide-tab-width) - var(--thin-tab-width)) * -1) !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment