Site specific stylesheets in Mozilla
New in Mozilla 1.8 Alpha 3: bug 238099—implement at-rule for matching on site/document URL. Here’s the example:
@-moz-document url-prefix(http://www.mozilla.org/) {
#q { background: white ! important; color: black ! important; }
}
Drop that in your userContent.css file for black-on-white search fields, but only for pages with URLs starting in http://www.mozilla.org/. Two other selection functions are available: domain(mozilla.org) for all page (and sub-domains) of the mozilla.org domain and url(http://www.mozilla.org/) for just the page matching that exact URL.
The sooner this makes it in to Firefox the better.
Quick thought: it would be nice if such a mechanism had a way to inform the UA to not use the author stylesheets, or to disregard even the default UA stylesheet.
Style overrides in user stylesheets are one thing, but if you're really obsessive about using your own styling---but only on specific sites---starting from a blank slate would be easier.
J. King - 19th August 2004 07:30 - #
Anne - 19th August 2004 07:55 - #
Phil Wilson - 19th August 2004 10:03 - #
Leandro Ardissone - 19th August 2004 14:43 - #
It certainly offers real possibilities and improvements over CSS-Signatures. But it remains a bit of a geek thing (as with all the user stylesheet problems) for now. One can't expect the average user out there to be able to create a user style sheet. What more is needed is a good interface to allow the user to interact with the page. Omniweb 5.0 has some interesting features in this regard.
Philippe - 19th August 2004 15:36 - #
There is a good use for this if you have your Windows colors inverted (ie. background color black and foreground color white or light grey). Plenty of sites fail to realize that when they specify a black text color for form fields (input / textarea), they should also specify a BACKGROUND color. And vice versa. You won't believe how often I encounter a page where I get black text on a black input field, or light grey text on a white input field.
This solution allows me to fix their faults, 'cos not all of them listen to input and apply the easy fix. *sigh*
Faruk Ates - 20th August 2004 12:23 - #
Another solution might be to use existing CSS2 to style the form fields using the system (Windows) colours. So they would always match what you had set Windows to look like.
See here for further details in a demo:
http://www.meyerweb.com/eric/css/tests/css2/sec18- 02.htm
Chris Hester - 20th August 2004 16:28 - #
David Schontzler - 21st August 2004 09:51 - #
In response to Phillipe :
I've got two points on this:
Glen Mailer - 21st August 2004 13:33 - #
This feature will not be in Firefox 1.0, because it's only in the bleeding-edge trunk for the backend, and Firefox 1.0 is based off a branch from that trunk (which isn't technically correct but is close enough) at a point when it was particularly bug-free.
It will be in Firefox 1.1, because Firefox 1.1 will be based off a branch from the bleeding-edge trunk at some point after 1.0 is released.
Jeff Walden - 22nd August 2004 19:14 - #
Answering to Glen: I am looking at the bigger picture here. Of course, only geeks use nightly builds or the latest Technology Preview. The problems with User Stylesheets, as far as the average user is concerned, are [1] the user has to know what a stylesheet is and [2] how to handle them (experience on mailing lists shows that even webdeveloppers have problems ...), the interaction between the various elements, the cascade, etc, etc...
Don't get me wrong. This new tool is very very nice, and I already use it with my Firefox nightly trunk build. And as soon as Moz 1.8 final is released, I'll be able to use this for the User Style sheet for my 70 years old neighbour. What I'd like to see, in the future, is a UI for handling user stylesheet, or at least some core features, such as font-sizing/background-colours. ChromEdit, or Edit CSS, are nice extensions; but my neighbour won't be able to edit this.
Philippe - 23rd August 2004 01:39 - #
daniel bennett - 27th December 2004 14:35 - #
Jane Jolin - 29th July 2005 18:21 - #
Jane Jolin - 29th July 2005 18:29 - #
mail.com user - 18th October 2005 05:08 - #
Sam Senteney - 2nd January 2006 20:28 - #
esquifit - 17th April 2006 20:09 - #
TO DANIEL BENNETT AND SAM SENTENEY
ONE REASON WHY STYLE SHEETS DON'T WORK IN FIREFOX
I don't know why classes won't be displaying and my information may be completely irrelevant to both of you but here it is for what it is worth, and for anyone else who ends up here with the problem I had.
I used a comment line in my style sheet so I would know when I last updated it. As would be usual in documentation, it was the first thing on the page. WRONG!!! This isn't a problem for Internet Explorer but in Firefox, it caused it to ignore the style information. If you want to put comment lines in stylesheets, Firefox needs them to be AFTER the code you want used.
Lyn - 14th September 2006 03:24 - #