W3C home > Mailing lists > Public > www-style@w3.org > December 2009

Re: Feature queries

From: Zack Weinberg <zweinberg@mozilla.com>
Date: Wed, 9 Dec 2009 10:05:42 -0800
To: W3C Emailing list for WWW Style <www-style@w3.org>
Message-ID: <20091209100542.7136d980@trurl>
fantasai <fantasai.lists@inkedblade.net> wrote:

> bz asked me to post a proposal on feature queries: syntax for allowing
> authors to apply CSS rules based on whether a particular CSS feature
> is supported.

I'm definitely for this in general, but I have some kibitzes.

> My proposal is two syntaxes. The first is an at-rule, which is handy
> if part of the style sheet depends on a major CSS feature such as
> Tempate Layout.
>    @supports ( declaration-block ) {
>       ruleset
>    }

This needs 'else' and 'else if' constructs.  How about

@if supports( ... ) {
@elif supports( ... ) {
@else {

This also makes it easier to extend the syntax of conditional
expressions later.  We could even subsume @media into it.

> This could potentially support media-query like operators like 'and'
> and 'not'.

Very much wanted, IMO.

> The second is a !important-like syntax: all declarations
> with !supported must be supported for the style rule to take effect.

I'm not sure I understand this.

>    tag {
>      color: white;
>      text-shadow: black 0 0 4px !support;
>    }

If the text-shadow property is not supported, the entire declaration
block is ignored?

How do shorthands behave, if just one of the subcomponents of the value
is not supported?

Received on Wednesday, 9 December 2009 18:06:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:41 UTC