Re: @else in Media Queries

On 14 June 2016 at 19:48, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Tue, Jun 14, 2016 at 7:12 AM, Sebastian Zartner
> <sebastianzartner@gmail.com> wrote:
>> On 14 June 2016 at 15:09, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>>> On Tue, Jun 14, 2016 at 3:28 AM, Sebastian Zartner
>>> <sebastianzartner@gmail.com> wrote:
>>>> One question to the presented syntax. You came up with an @when rule
>>>> additionally to the @else rule. Should these rules directly take a
>>>> condition? If so, they would need to cover media queries and support
>>>> queries (and maybe other conditional types in the future). Or should
>>>> they support @media and @supports rules inside their condition,
>>>> somehow?
>>>
>>> I'm not entirely sure what you're asking, because it *sounds* like
>>> it's something well-defined by the spec: @when and @else have a
>>> genericized condition language that covers both MQs and support
>>> queries.
>>
>> Which specification are you talking about? @when and @else are not defined yet
>> in Media Queries Level 4[1] yet. Or do you mean the syntaxes for the
>> @media and @supports rules in the different specs.[2][3]?
>
> No, I'm talking about the draft that I wrote.
>
> It's clear that we're not understanding each other, so you could you
> restate your original question?

It would have been great if you provided a link to your draft before. :-)

On 14 June 2016 at 21:45, Marat Tanalin <mtanalin@yandex.ru> wrote:
>
> 14.06.2016, 13:32, "Sebastian Zartner" <sebastianzartner@gmail.com>:
> > You came up with an @when rule additionally to the @else rule.
> > Should these rules directly take a condition? If so, they would
> > need to cover media queries and support queries (and maybe other
> > conditional types in the future). Or should they support @media
> > and @supports rules inside their condition, somehow?
>
> Corresponding functions are supposed to be used:
>
>     @when media(...) and supports(...) {...}
>
> See:
>
> [1] https://tabatkins.github.io/specs/css-when-else/
> [2] https://github.com/w3c/csswg-drafts/issues/112

Ah, that answers my question. Thank you, Marat!
So, just for clarification, my question was whether the queries are
directly listed within the @when and @else rules (so, e.g. @when
(max-width: 12cm) { ... }) or you should use the @supports and @media
rules within them (so, e.g. @when @media (max-width: 12cm) { ... }).
Though, obviously there are new functions media() and supports()
introduced instead.

Sebastian

Received on Wednesday, 15 June 2016 07:49:19 UTC