ActiveState Community

Customizing Projects/Source/Files tabs via userChrome.css

Posted by exorcyze on 2009-10-02 12:06
OS: All / Any

I'm trying to work on customizing the interface and have gotten the main file tabs to appear the way I like via userChrome.css ( similar to Coda style ). I used selectors for tabbox, tabs > tab and it all seems to work well. However, these have not carried over to the tabs in the left pane for Projects / Source / Files.

I can get the background to change using the selector "tabs", but can't override the aqua tab look.

Please note, that I have seen the samples on customizing - however these did not provide examples for the items above. Nor was I able to find it on the Mozilla site.

Can anyone help out? Many thanks in advance!

toddw | Tue, 2009-10-06 11:30

It should be possible to user userChrome.css to change the tab styling to be however you want. You might want to take a look at the TweakUI extension which can change the tabs settings:
http://community.activestate.com/xpi/tweak-ui

and also check out the Komodo specific styling of the tabs:
http://grok.openkomodo.com/source/xref/openkomodo/trunk/src/chrome/komod...

Cheers,
Todd

davep | Tue, 2009-10-13 04:16

I've been trying to do this for ages but never succeeded. Does anyone have an example to share please?

joeycalamaro | Sat, 2009-10-17 11:34

Does anyone have a working set of files they might want to share? The default Mac tabs are hideous (esp. in the sidebars).

exorcyze | Sun, 2009-10-18 16:20

I'll find what I did for the top tabs later tonight and post that - it makes them look like the tabs in Coda. Unfortunately I wasn't able to figure out how to get the aqua ones styled in the sidebar, which is what this post was about. =)

joeycalamaro | Sun, 2009-10-18 18:20

tabbox, tabs > tab {
-moz-appearance: none !important;
}

As I understand it, the above code should revert the sidebar tabs back to standard Firefox tabs. However it simply removes the sidebar tabs altogether. This leads me to believe the problem can't be fixed with userchrome.css. For whatever reason those sidebars don't call standard tabs.

Either way, I actually think no tabs look better than aqua tabs so it works for me.

exorcyze | Mon, 2009-10-19 14:52

Here's what I had done for Coda-style file-tabs, with icons added for file types:

/Users/{user}/Library/Application Support/KomodoEdit/5.2/{host}/XRE/chrome/userChrome.css

/* tab stylings similar to coda */
tabbox, tabs {
	background: #cfcfcf url(tab-normal.png) repeat-x left top !important;
	height: 20px !important;
	font-weight: normal !important;
	font-family: "Arial Unicode MS" !important;
	font-size: 11px !important;
}
tabs > * { background: transparent !important; }

tabs > tab * {
	background-color: transparent !important;
	background-image: none !important;
	font-weight: normal !important;
	font-family: "Arial Unicode MS" !important;
	font-size: 11px !important;
	text-shadow: 2px 2px 1px #FFF !important;
	color: #1B1B1B !important;
	padding: 0 !important;
	opacity: 1 !important;
	-moz-opacity: 1 !important;
}
tabs > tab {
	background: #cfcfcf url(tab-normal.png) repeat-x left top !important;
	border: solid #AAA !important;
	border-width: 1px 1px 1px 0 !important;
	border-top: 1px solid #404040 !important;
	height: 20px !important;
}
/* active tab */
tabs > tab[selected="true"] *, tabs > tab[selected="true"]:hover * {
	background-color: transparent !important;
	background-image: none !important;
	color: #FFF !important;
	font-weight: normal !important;
	font-family: "Arial Unicode MS" !important;
	font-size: 11px !important;
	text-shadow: 2px 2px 1px #333 !important;
}
tabs > tab[selected="true"], tabs > tab[selected="true"]:hover {
	background: #5998e2 url(tab-blue.png) repeat-x left top !important;
	font-weight: normal !important;
}

/* icons for file types */
#tabbed-view tabs > tab .tab-image-left {
	background-image: url(chrome://famfamfamsilk/skin/icons/page_white.png) !important;
	background-repeat: no-repeat !important;
	height: 16px !important;
	width: 16px !important;
	margin: 4px 0 0 5px !important;
	opacity: 0.75;
	-moz-opacity: 0.75;
}
#tabbed-view tabs > tab:hover .tab-image-left,
#tabbed-view tabs > tab[selected="true"] .tab-image-left { opacity: 1; -moz-opacity: 1; }
#tabbed-view tabs > tab[label$=".php"] .tab-image-left  { background-image: url(chrome://famfamfamsilk/skin/icons/page_white_php.png) !important; }
#tabbed-view tabs > tab[label$=".htm"] .tab-image-left  { background-image: url(chrome://famfamfamsilk/skin/icons/page_white_world.png) !important; }
#tabbed-view tabs > tab[label$=".html"] .tab-image-left { background-image: url(chrome://famfamfamsilk/skin/icons/page_white_world.png) !important; }
#tabbed-view tabs > tab[label$=".xml"] .tab-image-left  { background-image: url(chrome://famfamfamsilk/skin/icons/page_white_code.png) !important; }
#tabbed-view tabs > tab[label$=".css"] .tab-image-left  { background-image: url(chrome://famfamfamsilk/skin/icons/page_white_paint.png) !important; }
#tabbed-view tabs > tab[label$=".txt"] .tab-image-left  { background-image: url(chrome://famfamfamsilk/skin/icons/page_white_text.png) !important; }
#tabbed-view tabs > tab[label$=".js"] .tab-image-left  { background-image: url(chrome://famfamfamsilk/skin/icons/page_white_text.png) !important; }

/* unbold selected items in the tree views */
tabbox.sidepanel tree treechildren::-moz-tree-cell-text(selected), 
tabbox.sidepanel partviewer treechildren::-moz-tree-cell-text(selected) {  
  font-weight: normal !important;
}

I'm sure it's not the most fantastic, but it seemed to work for my purposes.

Here are the images. They go in the same directory:
http://imgur.com/delete/4CVbRCQZUa > Rename to tab-normal.png
http://imgur.com/delete/44NbPJaCi4 > Rename to tab-blue.png
http://imgur.com/delete/ttIsrmB8sh > Rename to tab-over.png