Skip to content

Instantly share code, notes, and snippets.

@Nitrousoxide
Last active September 3, 2024 21:44
Show Gist options
  • Save Nitrousoxide/493f0e66d9387e9def5e06d509a891e8 to your computer and use it in GitHub Desktop.
Save Nitrousoxide/493f0e66d9387e9def5e06d509a891e8 to your computer and use it in GitHub Desktop.
Tree Style Tabs

Based on the great work from theprojectsomething: https://gist.github.com/theprojectsomething/6813b2c27611be03e67c78d936b0f760

Select "Horizontal Tab Bar" and "Collapse Tree Style Tab" in the "Tab Bar Style" Select "Optimize browser for Vertical Tab Bar" to hide the Horizontal tab bar Screenshot from 2023-11-22 15-15-23

Under the advanced tab in the Tree Style Tab options past in the below theme.css image

The main points that might need tweaking for you would be:

/* This value should be updated here and in the userChrome.css */
  --tst-sidepanel-hide-delay: .5s;
}

which will determine how quickly the icons shift as you mouseover.

/* 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: 2em;
}

Will determine how much spacing to the right the name of the website gets. You will generally want this far enough that it's not showing when the tab bar is not being moused over

:root {
/* This value should be updated here and in the userChrome.css */
--tst-sidepanel-hide-delay: .5s;
}
/* 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;
}
/* resolve extra space for scrollbar (scrollbar is hidden by this script) */
.on-scrollbar-area #tabbar {
--shift-tabs-for-scrollbar-distance: 0px;
}
/* Include 'reveal' animation ... stagers by level */
#tabbar .tab {
transition: 0.1s margin-top, 0.2s 0.1s visibility;
}
#tabbar tab-item-substance {
transition: 0.2s 0.1s margin-left;
}
/* delay transitions on open */
#tabbar:not(:hover) tab-item-substance {
transition-delay: var(--tst-sidepanel-hide-delay);
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: 2em;
}
/* 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: -5px;
transition-delay: var(--tst-sidepanel-hide-delay);
}
/* 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;
}
/* active tab */
.tab.active {
background-color: rgba(255, 255, 255, 0.05) !important;
}
tab-item.active .highlighter::before {
background-color: #fffd !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 .label,
.tab.pinned .label-content {
opacity: 1;
position: unset;
padding-bottom: 0;
}
.tab.pinned .sound-button {
position: relative;
transform: none;
}
.tab.pinned .twisty {
display: block;
min-width: none;
width: auto;
}
@hauntedcupoftea
Copy link

hauntedcupoftea commented Sep 3, 2024

hello, I've been trying to use this theme and it mostly works perfectly, except for the fact that the add tab button has weird spacing compared to the rest of the tabs. It's kind of subtle but I would still appreciate tips on how to fix this as I cannot find anything about this in the code snippets from the extension settings.
image

image

@Nitrousoxide
Copy link
Author

Nitrousoxide commented Sep 3, 2024

hello, I've been trying to use this theme and it mostly works perfectly, except for the fact that the add tab button has weird spacing compared to the rest of the tabs. It's kind of subtle but I would still appreciate tips on how to fix this as I cannot find anything about this in the code snippets from the extension settings. image

image

Add this line to the end of your theme, tweak the margin-left to make it line up with your other icons. You can also make it negative if needed to go in the other direction

.newtab-button {
  display: yes;
  visibility: visible;
  margin-left: .25em;

}

@hauntedcupoftea
Copy link

thank you so much for the quick response.
that helps with horizontal alignment, but I'm seeing weird vertical alignment too. here are some examples
image
it's more apparent when the tab directly above is active as well.
image

@hauntedcupoftea
Copy link

image
here's a screenshot that shows the full button via the dropdown

@Nitrousoxide
Copy link
Author

not sure if this is entirely what's going on, but you can also add margins for the y dimension too, like this:

.newtab-button {
  display: yes;
  visibility: visible;
  margin-left: .25em;
  margin-top: .25em;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment