9

By default it looks like this:

enter image description here

I don't like it and want it to be dark, so I add this to my ~/.config/gtk-3.0/gtk.css:

terminal-window notebook tab {
    background-image: -gtk-gradient (linear, left top, left bottom,
                                     from (shade (@fg_color, 0.92)),
                                     color-stop (0.60, shade (@fg_color, 0.9)),
                                     to (shade (@fg_color, 0.85)));
    color: @bg_color;
}

terminal-window notebook tab:active {
    background-image: -gtk-gradient (linear, left top, left bottom,
                                    from (shade (@dark_bg_color, 1.2)),
                                    to (shade (@dark_bg_color, 1.12)));

   -unico-inner-stroke-color: alpha (shade (@dark_bg_color, 1.26), 1.0);
}

The result is:

enter image description here

Which is better, but active tab is not highlighted.

My reference is http://bazaar.launchpad.net/~maxb/ubuntu/trusty/ubuntu-themes/colours/view/head:/Ambiance/gtk-3.0/apps/gnome-terminal.css, but TerminalWindow .notebook tab selector does not have effect, so I changed it to terminal-window notebook tab (inspired by https://github.com/horst3180/arc-theme/blob/master/common/gtk-3.0/3.20/gtk.css#L3017, not sure why this difference in selector exists?) and it worked, but not with :active selector.

Any idea why this difference in selectors and why :active does not work?

Thanks!

umpirsky
  • 4,050
  • For your first question: Search for "GTK+ 3.20" and "CSS nodes", e.g. see this article and follow the two links from its first paragraph. Also note that correspondingly, under themes directories, there's a gtk-3.0 as well as a gtk-3.20 subdirectory. I have no clue about your second question (:active), sorry. – egmont Dec 29 '17 at 19:18
  • As per this post as well as the contents of /usr/share/themes/Ambiance/gtk-3.20/apps/gnome-terminal.css, I guess you might need the :checked selector instead. Let me know if it works, I'll convert these comments into an answer then. – egmont Dec 29 '17 at 19:26
  • Also remotely relevant, you might be interested in this: https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1726555. – egmont Dec 29 '17 at 19:37

1 Answers1

7

You can use the following style to get tab working:

/* gnome-terminal */
@define-color terminal_bg #300a24;
@define-color bg_color_active_tab #157bb7;


notebook.terminal-notebook header.top tab,
notebook.terminal-notebook header.top tab:hover {
    background-image: -gtk-gradient (linear, left top, left bottom,
                                    from (shade (@fg_color, 0.92)),
                                    color-stop (0.60, shade (@fg_color, 0.9)),
                                    to (shade (@fg_color, 0.85)));
    color: @bg_color;
}

notebook.terminal-notebook header.top tab:checked {
    background-image: -gtk-gradient (linear, left top, left bottom,
                    from (shade (@bg_color_active_tab, 1.2)),
                    to (shade (@bg_color_active_tab, 1.12)));
    color: @bg_color;

}

This will result in:

screenshot with highlighted tab