W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re: [css-variables] Variables in @page

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 1 Jun 2012 10:47:09 -0700
Message-ID: <CAAWBYDBiE=8yLS8NX-bdn+wOiy4mwqanWXRRLB5Lzrtf6tywjg@mail.gmail.com>
To: Simon Sapin <simon.sapin@kozea.fr>
Cc: Sebastian Zartner <sebastianzartner@gmx.de>, www-style@w3.org, florianr@opera.com, sylvaing@microsoft.com, shans@google.com, fremycompany_pub@yahoo.fr
On Fri, Jun 1, 2012 at 6:33 AM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> Le 01/06/2012 13:59, Sebastian Zartner a écrit :
>>> Many @-rules like @font-face or @counter-style contain
>>> *descriptors*. Descriptors have the same "name: value;" syntax as
>>> properties, but that’s it. They can not have !important and are not
>>> part of the cascade.
>>
>> That's the point. People might want to have variables available
>> everywhere, not just in the cascade.
>
> I was only describing the current draft as I understand it, but I can
> imagine how this is a problem. Suggestion to fix it:
>
> 1. Descriptors in @-rules can use variables defined on the root element.
>
> This matches the fact that @page inherits from the root element, except that
> descriptors themselves are not properties and thus do not inherit.

This is potentially reasonable, but I'm not sure how useful it is.  Use-cases?


> Extended proposition:
>
> 2. @-rules that accept descriptors can also define variables. Such
> definitions are scoped to the same @-rule block.

This seems less reasonable.  What's the use of a variable that can
only be used within the same block it's defined in?


>>> @page however contains real properties, as do margin rules inside
>>> @page. In fact, in recent css3-page drafts, @page inherits from the
>>> root element and margin boxes inherit from @page.
>>
>> I have to say that this is confusing. I believe @-rules shouldn't be
>> influenced by the cascade. But that's another topic.
>
> I disagree: I think it makes sense that properties (not descriptors) cascade
> somehow, wherever they are defined. But it is another topic indeed. Let’s
> start another thread on [css3-page] if this needs more discussion.

Drawing any conclusions about @-rules in general is a bad idea -
they're a general escape valve for everything in the language that
isn't a style rule.

In particular, @page rules are pretty much exactly just a style rule,
but they have to be shoved into the @-rule syntax because pages aren't
elements in the document.  Since they descend from the root, and have
children of their own, it makes just as much sense to have vars in
them as in a normal style rule.

~TJ
Received on Friday, 1 June 2012 17:47:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:55 GMT