Re: [css3] URI selectors

* Chris Moschini wrote:
>For this reason, why not offer as part of the CSS3 spec a selector that can differentiate
>between URIs? Something like:
>
>uri( "www.w3c.org" ), url( "www.w3.org" ) { font-size: 150%; }

Just on the syntax, I proposed something like

  foo[base()^="http://www.w3.org"]    { ... }
  foo[base()$=".svg"]                 { ... }
  foo[base()="http://www.w3.org/TR/"] { ... }
  foo[base()*="/ad/"]                 { ... }

To reuse syntax/functionality and to allow authors to use it in
documents using xml:base. If the latter is not desired, it could
be document-uri() instead. If one expects to have many rules
there could be a @context <selector> at-rule like

  @context [base()^="http://www.w3.org"] {
    h1 { ... }
    ...
  }

or

  @context [base()^="http://www.w3.org"];
  h1 { ... }
  ...

which could resolve to

  [base()^="http://www.w3.org"] h1 { ... }
  [base()^="http://www.w3.org"] ...

@context would of course be useful without base(), too.

Received on Sunday, 4 January 2004 02:13:30 UTC