Domain specific UserChrome.css and UserContent.css?

edited April 2008 in Stylish
I've been trying to Style a webpage's background color and firefox's active tab color depending on the domain I'm browsing but so far, I am only getting the change in one of them and not in both.

As an example what I would like to do is access http://mail.google.com change its background color to green (or any color) and make firefox's active tab green as well; and if a change to another domain say http://news.google.com/ I would like its background color to change to yellow and make the active tab yellow. I believe this involves changes in UserContent.css and UserChrome.css and these changes should be conditioned some type of domain specific rule.

So far I've been trying to use @-moz-document domain() to try to implement this condition, but I think it only works for UserContent and not UserChrome. Is there any way to implement this functionality using Stylish or using UserChrome.css alone? I would really appreciate if anyone can help me with this. Thanks.

Comments

  • With CSS alone, you can't style a parent based on the child. The HTML document is a child of the tab, so you can't change the tab based on what's in the document.
  • But can you change de tab based on what is on the url or domain? Or is the domain validation done on the document base level?
  • The @-moz-document stuff works on the document's URL. The tabs are part of a Firefox chrome document with an internal URL, not the HTML document with the external URL.
  • Actually, you might be in luck! If you want to style a tab according to the domain, the TAB element has an attribute called IMAGE which is the URL for the Favicon it displays. If the website has a favicon then you can do this:

    @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
    tab[image*="example.com"] {background:red !important;}
Sign In or Register to comment.