I've customized TST's appearance using the "Extra style rules for sidebar contents". I'd like to write style rules to change the sidebar's color scheme based on which Firefox theme is currently active. Specifically, when my macOS Mojave system switches between light and dark mode, Firefox automatically switches between the built-in Light and Dark themes, and I'd like TST to adapt to that.
I've tried this:
.tab:-moz-lwtheme-darktext { background-color: red; }
and this:
.tab[lwthemetextcolor="dark"] { background-color: red; }
鈥ut neither rule matches.
It is impossible, because Firefox doesn't expose such information via WebExtensions API.
Ah, I see. Thanks for your quick response.
https://bugzilla.mozilla.org/show_bug.cgi?id=1435216 might be the relevant Firefox issue?
Yes, it looks similar to the one we need.
TST鈥檚 sidebar uses dark colors when I use the dark browser theme in Firefox 67.0:

I鈥檓 not sure how it happens. In the Browser Toolbox I only see a <browser> element in the sidebar, and the inspector鈥檚 element picker does not select anything inside of it.
Overall this looks good, except for the scrollbar which looks out of place because it uses light colors.
@SimonSapin You should use a remote debugger for the target addon. You can start it via about:debugging. And you can change the color of scrollbars with the scrollbar-color property, like:
body {
scrollbar-color: var(--theme-colors-icons) var(--theme-colors-toolbar);
}
Thanks! Both very helpful tips. For anyone else trying this: once the remote debugger is open, don鈥檛 forget to pick the correct document/frame with the icon on the top right.
I ended up with:
#tabbar { scrollbar-color: var(--tab-border) var(--tabbar-bg); }
Back to the original bug for this issue, it looks like this is fixed? In my case the declaration for relevant CSS variables are coming from /sidebar/styles/square/plain-color-dark.css
Back to the original bug for this issue, it looks like this is fixed?
I think the problem still exists. Colors of "Dark" and "Light" theme are notified via WebExtensions API, but colors of the default theme are not yet.
I know there has been improvements based on light and dark mode. Is this issue still relevant with current builds?
So this issue looks to be resolved already.