W3C home > Mailing lists > Public > www-style@w3.org > May 2013

Re: DRYing up media queries

From: Yoav Weiss <yoav@yoav.ws>
Date: Sat, 25 May 2013 23:03:10 +0200
Message-ID: <CACj=BEiSYyr98YfpfjL8ZD9tFJON-bLJ3kJg8J80DgLdragPkQ@mail.gmail.com>
To: Simon Sapin <simon.sapin@exyr.org>
Cc: www-style list <www-style@w3.org>
OK, I'm convinced that doing that in CSS is probably a bad idea.
Would you consider an HTML based syntax to address this use-case better? Is
such a syntax within the scope of the CSSWG? HTMLWG? Both?


On Sat, May 25, 2013 at 4:31 AM, Simon Sapin <simon.sapin@exyr.org> wrote:

> Le 25/05/2013 09:30, Tab Atkins Jr. a écrit :
>
>  We could possibly say that properties defined on the root element are
>> accessible across the stylesheet, but that might be weird.
>>
>
> In addition to being weird, we’d have to find some way to break the
> definition cycle that usually prevented by this part of css3-mediaqueries:
>
>  To avoid circular dependencies, it is never necessary to apply the
>> style sheet in order to evaluate expressions. For example, the aspect
>> ratio of a printed document may be influenced by a style sheet, but
>> expressions involving ‘device-aspect-ratio’ will be based on the
>> default aspect ratio of the user agent.
>>
>
> For example, how would this work?
>
> :root { var-my-query: (min-width: 600px) }
> @media var(my-query) {
>    :root { var-my-query: (max-width: 600px) }
> }
>
> --
> Simon Sapin
>
>
Received on Saturday, 25 May 2013 21:03:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:30 UTC