On 01/08/11 23:31, Stanimir Stamenkov wrote:
Mon, 01 Aug 2011 23:22:51 +0200, /Tony Mechelynck/:You mentioned the !important modifier, but don't forget the :not() pseudo-class. For instance you could have used something like (untested) .important:not(:hover):not(.other) { color: inherit !important } .important { font-weight: bold }Yeah, but that requires one to study much more of the author style sheet in order come up with the more specific selector, instead of just using the one given in the original author rule. It won't prevent from overriding similar rules the author adds in a later stage, also.
As a rule of thumb, I recommend to always have the DOM Inspector ready when adding rules to userChrome.css or userContent.css — that tool lets you know easily which CSS rules apply where. No need to retrieve and analyse the full text of all the separate style sheets which may be cascaded over any data or chrome element.
As for the Stylish extension, I've heard it praised left and right — I don't use it myself but I suppose it has its merits. You'd have to ask someone familiar with it about how useful or how redundant DOMi may be if you use Stylish.
Whatever you do, if your content pages or your chrome evolve, someday your CSS rules are going to break: I take that as a fact of life. I had a userChrome.css set of rules to get "flowing tabs" (i.e., a multi-row tab bar) in SeaMonkey, as a replacement for one useful feature of the Firefox-only Tab Mix Plus extension. My rules worked perfectly in SeaMonkey 2.0.x and in 2.1a* older than 2010-12-27; but then there was a change in the tabbrowser XUL and my rules broke. It cost me about a week of patient detective work before I found (with the help of DOMi) how to get my flowing tabs back in later versions of SeaMonkey 2.1* and above, but I finally succeeded, actually with somewhat simpler rules because additional classes had been added where I previously had to follow several levels of vtab > vtab > htab heredity: similarly, if you have written an @-moz-document section for some site and the site HTML changes, your CSS may break; then you'll have to come back and change whatever needs changing. /C'est la vie/.
Best regards, Tony. -- Slowly and surely the unix crept up on the Nintendo user ... _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

