W3C home > Mailing lists > Public > www-style@w3.org > April 2005

Re: Conditional CSS sections based on property support

From: Mikko Rantalainen <mikko.rantalainen@peda.net>
Date: Wed, 06 Apr 2005 13:05:04 +0300
Message-ID: <4253B450.9040405@peda.net>
To: www-style@w3.org

Laurens Holst wrote:
> Problem with this is that if you want to use e.g. browser-specific CSS 
> to solve certain issues, it needs to be excluded from the group somehow. 

The key words here are "browser-specific" and "certain issues". I 
think the real problem you're trying to solve is forward compatible 
workarounds. As it's workaround, I don't think the rest of the 
styling should be affected by it.

> Because such a single rule would make the block not be applied on all 
> other browsers as they do not support it, yet it would need to be part 
> of the group because it depends on the condition.

That's a good point. Previously I'd have suggested to just use that 
special property outside the @require-all-properties section but it 
might not make any sense without the other rules.

> @require-all-properties {
>     div {
>        width: 100px;
>        padding: 10px;
>     }
>     div {
>        -mox-box-model: border-box;
>        box-model: border-box;
>     }
> }
> How would this work? !exclude? That seems kinda counter-intuitive

As the expected use case is for some kind of workaround I think it 
doesn't need to be nice. If making this feature look nice would make 
using the real feature (@require-all-properties or something like 
that) even a little bit harder I would object such change. I think that

   -mox-box-model: border-box !not-required;

would be a good fix. I, as a style designer, know that this style 
could be applied only by vendor "mox" and therefore there's no need 
to hide that from other UAs. On the other hand, because I've added 
the rule in first place, I've obviously already tested that this 
proprietary feature is required *for this UA*. And there's no need 
to tell that UA that it's a required part because we already know 
that it's supported. However, other UAs need to be told that they 
can ignore this part. A string like "!not-required" or something 
along the same lines sounds good to me for this purpose.

As a side note: should @require-* rules be allowed to be nested? I 
can think of cases where somebody could want to write


Received on Wednesday, 6 April 2005 10:05:08 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:17 UTC