W3C home > Mailing lists > Public > www-style@w3.org > August 2004

per-site user stylesheet rules

From: L. David Baron <dbaron@dbaron.org>
Date: Thu, 19 Aug 2004 14:06:54 -0700
To: www-style@w3.org
Message-ID: <20040819210654.GA14706@darby.dbaron.org>

I've implemented an at-rule allowing per-site user stylesheet rules in
Mozilla.  It's available in Mozilla 1.8 alpha 3.  This is based on the
idea proposed in [1], although with different syntax.

The syntax that I've implemented is the addition of an @-moz-document
rule that works like an @media rule and has the syntax (in some
reasonably typical notation):

docrule ::= "@-moz-document" S+ url-list "{" S* ruleset* "}"

url-list ::= url-item ( "," S* url-item )*

url-item ::= ( "url(" | "url-prefix(" | "domain(" ) URL ")" S*

where S is from the CSS2 tokenization, ruleset is from the CSS2 grammar,
and URL is like the production URI in the CSS2 tokenization except
without the 'url(' and ')'.

To define the three functions by example:

@-moz-document url(http://www.w3.org/),
               url-prefix(http://www.w3.org/Style/),
               domain(mozilla.org)
{
  /* CSS rules here apply to:
     + The page "http://www.w3.org/".
     + Any page whose URL begins with "http://www.w3.org/Style/"
     + Any page whose URL's host is "mozilla.org" or ends with
       ".mozilla.org"
   */
}

-David

[1] http://lists.w3.org/Archives/Public/www-style/2003Dec/0058.html

-- 
L. David Baron                                <URL: http://dbaron.org/ >

Received on Thursday, 19 August 2004 21:07:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:32 GMT