r/firefox•
caligari87

Editing userChrome.css, and I can't seem to find the right classes for my active tabs.

Solved

So far, I've got this figured out:

#TabsToolbar > *{
	background-color: #d6d6d6 !important;
}

tab [selected]	{
	background-color: #f5f6f7 !important;
	color: black !important;
	border: 0px solid transparent !important;
	border-left: 1px solid #b6b6b8 !important;
	border-top: 1px solid #b6b6b8 !important;
	border-right: 1px solid #b6b6b8 !important;
}

Using the light developer theme, this nicely blends my Linux titlebar with the tab bar, and adds a nice border. However, with this screenshot, you'll see the problem: The border I'm trying to add to the active tab cascades down to the sub-elements; icon, text label, close button. Now, try as I might, I cannot find right class/selector to just affect the tab itself.

I'd also settle for finding the right CSS classes to un-define the border farther down, something like--

.tab-content > * { 
	border: 0px solid transparent !important;
}

--but that doesn't do it, nor does anything else I try. Granted, Firefox's CSS is incredibly convoluted and I'm still learning how selectors work, so maybe I'm just formatting it wrong. Any hints?

Posted Sep 25, 2015, 4:41 AM UTC

17

Umm. I think all you need to do is remove the space between "tab" and "[selected]"

2
caligari87OP•

Tried that, now it doesn't override the default blue tab border from the dev theme anymore.

http://imgur.com/m5n696e

1

That's because it's box-shadow rather than border. Set the box-shadow to none to get rid of it.

2
caligari87OP•

Haha! I think that did it! Here's the final code:

#TabsToolbar > *{
	background-color: #d6d6d6 !important;
}

tab[selected]  {
	background-color: #f5f6f7 !important;
	color: black !important;
	border: 0px solid transparent !important;
	border-left: 1px solid #b6b6b8 !important;
	border-top: 1px solid #b6b6b8 !important;
	border-right: 1px solid #b6b6b8 !important;
	box-shadow: none !important;
}

And the final result. Thanks so much, I never would have guessed to try box-shadow.

1

Looks nice and clean alright. Box shadow is used in many other places too. I guess the reason for that is partly because border expands the bounding box so it could be rather awkward to use for styling purposes. Whereas with box shadow, all boxes - tabs in this case - are the same size but there is just box shadow drawn over the selected one.

2