Re: [css21] @import parsing

On Feb 4, 2009, at 1:55 PM, L. David Baron wrote:

> On Wednesday 2009-02-04 13:43 -0800, Peter Linss wrote:
>> Agreed. Perhaps the text should read: "after any well-formed  
>> statement",
>> or simply "after any statement".
>
> I'm a little uncomfortable with ignoring @import after an unknown
> @-rule.  That would mean we couldn't extend CSS with new @-rules
> that belong before @import.  (For example, an @base rule to set the
> base URL, like html:base or xml:base.)

I think the argument was not to ignore @import after a valid  
_anything_, but after valid regular CSS rules, e.g. once you start  
using a selector and properties, @import should no longer import.  
Prior to that, though, you can (and should continue to be able to) use  
as many @-rules with any @-names as you want.

So, this would import "foo.css":


@blah something {
	…
}
@bar {
	…
}
@import "foo.css";
selector {
	prop: value;
}


…but this would not:


@blah something {
	…
}
selector {
	prop: value;
}
@import "foo.css";



That was my understanding of it, anyway. Either way, I think that's a  
viable approach.

Faruk

Received on Tuesday, 10 February 2009 21:03:32 UTC