Re: Does an @media cascade with the generic sheet?

On Dec 4,  1:42pm, Neil St.Laurent wrote:

> Does an @media style sheet cascade with all of those rules outside of
> the @media declaration?

Yes. The outermost block or rules, outside an @media can be assumed to
be inside an @media all block, if you like to think of it that way.

> If an @font-face with the same name is declared aboth inside an
> @media and outside an @media which is used?

Same font-family name,  font-weight, font-size font-style and
font-variant (all are used to performa match). One of them is ignored.
The spec does not currently state which one is ignored. If you think
it should, I welcome your suggestions for a rule.

> I know this is likely
> the one inside, but the standard doesn't specifically address certain
> issues like this.

It does say (in the font matching algorithm, step one) that one of them
is ignored if all the descriptors are the same.

> Why is @import not available inside an @media?

Because @import is restricted (in CSS1) to being at the top of the
stylesheet before the rules. In particular, it is supposed to be an
import not a textual include. Restricting @import in this way is supposed
to help with efficiency.

The possibility of allowing an import mechanism (whether @import or
some other mechanism) inside of an @media, or of adding an @media-import
has been discussed.

> Or is this because the imported style sheet would be required to be
> basic (without @media) and thus the import a misnomer.

No, that wasn't it.
>
> Here is a possible suggestion:

> consider @incmedia that allows you to include another @media
> declaration as part of the current set:
>
> @media common   { color: red;

That would be all rather than common, but I see your point. Putting it
into the same style sheet and then im,porting seems a little odd though.
Why not just

@media screen, overhead   { color: red;
     background: green; }

@media screen {  font-size: 14pt; }

@media overhead { font-size: 24pt; }


> In CSS2 I'm to assume a UA is supposed to use the "screen" media
> declaration as opposed the generic one?

Not sure what you mean there.

-- 
Chris Lilley, W3C                          [ http://www.w3.org/ ]
Graphics and Fonts Guy            The World Wide Web Consortium
http://www.w3.org/people/chris/              INRIA,  Projet W3C
chris@w3.org                       2004 Rt des Lucioles / BP 93
+33 (0)4 93 65 79 87       06902 Sophia Antipolis Cedex, France

Received on Friday, 5 December 1997 06:24:52 UTC