- From: Mikko Rantalainen <mikko.rantalainen@peda.net>
- Date: Thu, 15 Sep 2005 12:38:17 +0300
- To: www-style@w3.org
Laurens Holst wrote:
> Malcolm Rowe schreef:
>>
>>Can @required be implemented in such a way that it is useful with
>>browsers that don't understand it, or do we have to wait until all
>>CSS-capable browsers implement @required before we start using it?
>>
>>Because it seems to me that a naïve implementation (or design), i.e.:
>>
>>@required {
>> color: black;
>> background: white;
>>}
>>
>>would actually result in none of the rules being applied in today's
>>UA's. Or am I mistaken?
>>
>
> And we’re back to my point at:
>
> http://www.grauw.nl/articles/css-faq.php#how-long
Not quite but close. The @required feature would be one that style
authors could safely use immediately after even a one UA supported
it. Unlike using "position: fixed" today or "border-radius" with big
values without specifying huge amount of padding for everybody in
the near future.
Granted, there's the chicken and egg problem - why should I as a
style author use @required if everything inside it *will* be ignored
by all current UAs? And if nobody uses @required why should an UA
implement it?
Some CSS rules make sense only when combined with other rules and
there's no way to correclty handle this situation currently. The
@required *seems* to be a way out. I'm happy to hear how you would
solve the following rules without @required:
selector { padding: 0.25em; }
@required
{
selector { padding: 0.75em; border-radius: 1em; }
}
Note that if I instead write
selector { padding: 0.75em; border-radius: 1em; }
then UAs without implementation of 'border-radius' will be huge
amount of padding which looks bad. On the other hand, if I use rule like
selector { padding: 0.25em; border-radius: 1em; }
then my style looks okay in UAs which support 'padding' but do not
support 'border-radius', but UAs that support both, might end up
clipping part of the actual content because of the rounded corners.
I consider @required feature important for shortening the time it
requires before *new* CSS features can be used in live. Many new CSS
features require setting multiple properties to get maximum out of them.
--
Mikko
Received on Thursday, 15 September 2005 09:38:32 UTC