Re: Conditional CSS sections based on property support

Good points.

Ben Ward wrote:
> Err, that's quite wordy. A quick example:
> 
> @group 
> {
>  foo > bar
>  {
>   background-color: #0F0;
>  }
> 
>  foo > bar + banana !required
>  {
>   some-unsupported-property: blah !required;
>   color: #F00;
>  }
> } /* end of group */
> 
> The first style would ordinarily be fine, the second style is required
> for the application of the entire group. The second style will fail if
> some-unsupported-property is not implemented and thus the failure will
> cause the entire group to fail.
> If "some-unsupported-property" was *not* marked as !required, however,
> then "foo > bar +banana !required" would *never* fail, even if s-u-p
> was unimplemented.

It seems more logical if it would work the other way. That a 
group/selector fails if one of its properties marked with !required is 
not supported makes sense. However on a selector without !required (I 
wonder if that is a desireable syntax extension) where all unsupported 
properties make it fail, I would expect that to work the other way 
around. That is, only make them fail when the entire selector is marked 
as required.


> I feel more comfortable with "opt-in", defining failure conditions,
> than defining conditions for non-failure.

I agree.

I was just trying to take a look at disadvantages, and maybe take a 
different approach. However, the ability to mark an entire selector as 
required seems useful.

Lemme throw ye another problem then: what about alternate rendering? 
Surely, if a property being not supported causes a whole bunch of other 
styles not being applied, this will leave a clearly visible ‘gap’ in the 
page style. Imagine a menu suddenly being rendered in its plain <li> 
HTML form.

Should this purely be handled through the cascading and clever 
distribution of properties over required and nonrequired selectors? That 
might be bothersome. Some kind of cascade through ‘alternate styling 
options’ until a supported one is found might be more convenient. But 
more difficult to maintain and test, and what would the syntax be.

As I said, it /could/ be done with just this, letting source order (CSS 
cascading) take care of it, but it wouldn’t be convenient at all.

Yet, something must be there, because with something like this making 
entire groups of properties not apply instead of single ones (which 
might still scale down ok), you can’t just replace it with nothing.

Ideas? :)


~Grauw

-- 
Ushiko-san! Kimi wa doushite, Ushiko-san!!

Received on Monday, 4 April 2005 23:32:04 UTC