|
Posted by Andy Dingley on 04/19/07 10:34
On 18 Apr, 20:48, "Jon Slaughter" <Jon_Slaugh...@Hotmail.com> wrote:
> I have no idea why css can't have an selector algebra?
1. Because it just doesn't. Don't ask us, we're just the monkeys who
use it. If you want it to have one, then you have to change the CSS
recs (and browsers) rather than just writing pages in some new
invented syntax.
2. Because it doesn't need one. The level at which HTML works is
supposed to be pretty dumb and close to the "end result" of a finished
document. CSS is supposed to be (in the great architectural view)
simple and efficient to implement, rather than powerful
If you need a magic selector, stick it into the HTML (class / id etc.)
and use trivial CSS to select it. If you need lots of these selectors,
then generate them from some precursor format to HTML (which might
also be HTML or XHTML) and get them into the final HTML document
before the CSS ever sees it.
If you care about this stuff, I strongly recommend that you read Hakon
Lie's PhD thesis on the design of CSS and the precursor technologies
that it was either based on, or deliberately rejected. What you
describe has some commonality with DSSSL's approach. As we know how
successful _that_ was, CSS deliberately avoided that route.
Navigation:
[Reply to this message]
|