-
Notifications
You must be signed in to change notification settings - Fork 278
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
Customizing the TST UI #1725
Comments
The sidebar HTML file located at master/webextensions/sidebar/sidebar.html has the general structure of the sidebar elements. You can see a tab's structure with from the element with the id <li class="tab">
<span class="favicon">
<span class="throbber"></span>
</span>
<span class="label"></span>
<span class="counter"></span>
<span class="closebox"></button>
</li> The normal CSS rules applied to the sidebar can be found in master/webextensions/sidebar/styles. The A lot of names for color variables seems to be collected in the rules for the You could also try to inspect the sidebar webpage with Firefox itself. To do this you need to find the sidebar URL. It should be something like Tree Style Tab's id can be found by opening a group tab. Do this by rapidly opening several tabs (hold TST's group tabs' have the URL You could also find the extension id by opening the Once you have opened the sidebar in its own tab you can use Firefox development tools to inspect the page. You can open those through the FIrefox menu button or with the keyboard shortcut |
@Lej77 thank you for such a detailed reply! |
@Lej77 Thanks a lot! I've added a link to your comment from the FAQ (README.md). |
@Lej77 if you have some free time, could you please help me style a few things or point to a right direction? I can't seem to figure out the necessary rules to decrease the margin between the pinned tabs ( |
@affectiosus To open pinned tabs to the end of the list you could try to use the extension Pinned Tabs Fix by nralbrecht. However from my testing there seems to be some incompatibility issues with Tree Style Tab. So it works some of the time but not always. Also it seems to work better if it is initialized after TST. So if you deactivate the pinned tab extension and then reactivate it you get better results. Don't know if piroor could do something about that. |
@affectiosus Pinned tabs seems to be controlled via JavaScript at the moment so their position is a bit hard to control. I managed to bypass the JavaScript with the following CSS code: #tabbar {
margin-top: 0px !important;
}
.faviconized {
position: relative !important;
left: initial !important;
top: initial !important;
float: left;
}
.tab:not(.faviconized) {
clear: left;
} This does have the side effect of making the pinned tabs scroll with the normal tabs. |
@affectiosus To control the closebox size you can use the following CSS: :root {
--closebox-text-margin: 5px;
--closebox-roundness: 100%;
--closebox-height: calc(var(--tab-height) * 0.7);
--closebox-width: var(--closebox-height);
--closebox-cross-size: 0.8;
}
.closebox {
min-height: var(--closebox-height);
max-height: var(--closebox-height);
min-width: var(--closebox-width);
max-width: var(--closebox-width);
margin-left: var(--closebox-text-margin);
border-radius: calc(var(--closebox-roundness) / 2);
}
.closebox:after {
height: calc(var(--closebox-height) * var(--closebox-cross-size));
width: calc(var(--closebox-width) * var(--closebox-cross-size));
margin-top: calc(var(--closebox-height) * (1 - var(--closebox-cross-size)) / 2);
margin-left: calc(var(--closebox-width) * (1 - var(--closebox-cross-size)) / 2);
}
|
@affectiosus I did some more research about pinned tabs and in the file webextensions/sidebar/pinned-tabs.js at line 56 I found that the JavaScript used the size in the variable I made the following CSS code to change the pinned tabs size using this information: :root {
--faviconized-tab-size-script: calc(var(--faviconized-tab-size) / 1.75);
}
#dummy-favicon-size-box {
min-height: var(--faviconized-tab-size-script);
max-height: var(--faviconized-tab-size-script);
} Any changes to the pinned tabs' sizes will be applied after the sidebar is closed and reopened. |
@Lej77 thank you so much for your time and effort. If you're fine with a bit more digging, could you please suggest the possible reason(s) for the close mark to "stick" to the top of the tab? It looks more or less like this, no matter what I try: |
@affectiosus Unfortunately, without your styling rules it is very hard for me to understand why the close mark would behave that way. I tried with the ones you linked before but I don't see that problem with them. Also about opening tabs from pinned tabs at the end of the list. You don't need any other extension for this. Since TST 2.4.6 this can now be done by changing the TST's setting |
@affectiosus I had another look at your problem and your right about the cross not being centered. I was testing under TST's :root {
--closebox-text-margin: 4px;
--closebox-roundness: 100%;
--closebox-height: calc(var(--tab-height) * 0.75);
--closebox-width: var(--closebox-height);
--closebox-cross-size: 0.75;
}
.closebox::before,
.closebox {
min-height: var(--closebox-height) !important;
max-height: var(--closebox-height) !important;
min-width: var(--closebox-width) !important;
max-width: var(--closebox-width) !important;
border-radius: calc(var(--closebox-roundness) / 2) !important;
padding: 0px !important;
margin: 0px !important;
}
.closebox {
margin-left: var(--closebox-text-margin) !important;
margin-top: calc(-1 * var(--closebox-height) / 2) !important;
margin-bottom: calc(-1 * var(--closebox-height) / 2) !important;
}
.closebox::after {
height: calc(var(--closebox-height) * var(--closebox-cross-size)) !important;
width: calc(var(--closebox-width) * var(--closebox-cross-size)) !important;
margin-top: calc(var(--closebox-height) * (1 - var(--closebox-cross-size)) / 2) !important;
margin-left: calc(var(--closebox-width) * (1 - var(--closebox-cross-size)) / 2) !important;
} |
@Lej77 thank you a lot! The code you've suggested works better than perfectly. |
Hello!
This may be a lame issue. I've recently migrated from FF56 and since Tree Tab has not been rewritten for WE API, I decided to stick with TST for now. The available styles do not suit me, so I've decided to make my own. However, I failed to find at least a list of available parameters I can customize. Some are listed on the snippets page in the wiki, but not all. So my question is, is there a list of all the options I can customize somewhere, or can I see it in one of the TST's files?
The text was updated successfully, but these errors were encountered: