-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: tab counter #1661
Comments
This works fine IMO: |
I have not been able to get that extension to work. But, IIUC, even if I got it to work, the tab count would be in a completely different place in the UI than at the bottom of the tab tree. |
You can use some CSS code in the Advanced section of TST's Option menu. You can count tabs using something like: For example the following CSS will display the current window's tab count on the new tab button: /* Tab Counter on New Tab button */
#tabbar {
counter-reset: tabs;
}
.tab {
counter-increment: tabs;
}
.newtab-button::after {
content: counter(tabs) " tabs";
pointer-events: none;
position: absolute;
left: 0.2em;
/* TST 2.4.0 - Fix for Issue #1664 */
background: transparent !important;
mask: none !important;
} |
That is a very ingenious workaround :) And it's impressive that TST supports this kind of extensibility! I don't suppose there's a way to get the count to be below (as opposed to beside) the "+"? |
@theres-waldo The following CSS should show the tab count bellow the "+" sign: /* Tab Counter on New Tab button */
#tabbar {
counter-reset: tabs;
}
.tab {
counter-increment: tabs;
}
.newtab-button::after {
content: counter(tabs) " tabs";
top: -0.2em;
margin-bottom: -0.1em;
pointer-events: none;
position: relative;
display: block;
/* TST 2.4.0 - Fix for Issue #1664 */
background: transparent !important;
mask: none !important;
} The Note: When you apply the new CSS code you might need to close and reopen the sidebar to fix the last tab being hidden behind the larger new tab button. |
Also if you want the tab counter text to have the same opacity as the "+" sign then you can add the following CSS code: .newtab-button::after {
opacity: var(--button-opacity);
}
.newtab-button-box:hover .newtab-button::after {
opacity: var(--button-hover-opacity);
} Sometimes I had some problems with the code above. This mostly happened when I resized the new tab button. It caused the tab counter's text font to be different when it was hovered (though it only happened when the scroll bar wasn't visible). I used the following CSS as a workaround: .newtab-button::after {
opacity: var(--button-opacity);
}
.newtab-button-box:hover .newtab-button::after {
opacity: .989;
}
|
Thanks! |
After TST 2.4.8 there will be an option in TST settings under the header The following CSS code will slide the tab count away from the selector when it is visible: /* Slide tab count away from selector */
:root.newtab-action-selectable.contextual-identity-selectable .newtab-button::after {
transition: margin-left 0.1s;
}
:root.newtab-action-selectable.contextual-identity-selectable .newtab-action-selector-anchor.open ~ .newtab-button::after,
:root.newtab-action-selectable.contextual-identity-selectable .newtab-button-box:hover .newtab-button::after {
margin-left: 20px;
} The following CSS code will slide in the selectors from the sides and can be used in combination with the code above: /* Slide in selectors */
:root.newtab-action-selectable.contextual-identity-selectable .newtab-button::after,
.newtab-action-selector-anchor,
.contextual-identities-selector-anchor {
transition: 0.2s ease-in-out !important;
}
:root.newtab-action-selectable.contextual-identity-selectable .newtab-button-box:not(:hover) .newtab-action-selector-anchor:not(.open) {
left: -20px !important;
}
:root.newtab-action-selectable:not(.contextual-identity-selectable) .newtab-button-box:not(:hover) .newtab-action-selector-anchor:not(.open),
:root.contextual-identity-selectable .newtab-button-box:not(:hover) .contextual-identities-selector-anchor:not(.open) {
right: -20px !important;
} |
In FF90b12 the snippet needs a little update, as the width of the plus sign on the original new-tab-button doesn't reserve enough space anymore. So it would break the text into multiple lines. The old block: .newtab-button::after {
content: var(--tab-count-text);
pointer-events: none;
position: absolute;
left: 0.5em;
/* TST 2.4.0 - Fix for Issue #1664 */
background: transparent !important;
mask: none !important;
} Becomes: .newtab-button::after {
content: var(--tab-count-text);
pointer-events: none;
width: 100%;
/* TST 2.4.0 - Fix for Issue #1664 */
background: transparent !important;
mask: none !important;
} @piroor Could you please update the documentation? |
@private-lock |
@private-lock It is OK (and recommended) to update the page by yourself, it is a wiki - editable by anyone. |
Prior to WebExtensions, I used a Firefox extension called Tab Counter which added a counter at the end of the tab bar (not scrolled with the tabs, but fixed in place).
This extension "just worked" with Tree Style Tab: the counter would appear at the bottom of the tab tree (also not scrolled).
With the WebExtensions version, this does not work anymore, since the tab tree is now a sidebar rather than the actual tab bar.
Would you consider adding an optional tab count natively to TST?
The text was updated successfully, but these errors were encountered: