Re: Class Selectors Extension Proposals

Daniel Glazman wrote:

> Alberto Pacheco wrote:
>     Does CSS support the following class descriptors functionality?
>  [...]
>      2) Parametrized classes
>     How do I get something like:
>         .c(X,Y) { width:X; color:Y; }
>     To be refered in HTML later as:
>         <span class="c(50%,red)">
>     Where class c becomes equivalent to ".c { width:50%; color:red;)"
>  
> I know it sounds crazy.. 
> 
> Oh ! That one is interesting and not so crazy. We already have pseudo-classes accepting 
> parameters, so why not classes (theoretical question only)...
> Unfortunately it's not only on the CSS side and would imply a modification of the class attribute's 
> model.

The modification of the 'class' attribute's model is one good reason to avoid 
parametrized classes.

The separation of structure and style is another good reason to avoid parametrized 
classes.

> Bert, what do you think ?

Bert noted, "In general, it is better to keep stylistic info out of the document, but when it 
is needed, it is better to put it in one, dedicated attribute, and not mix it with
other mark-up." (<mid:15587.56593.874090.69287@jfouffa.inria.fr> / 
<http://lists.w3.org/Archives/Public/www-style/2002May/0090.html>)  I thoroughly agree.  
Parametrized classes seem like a solid backward step into the land of HTML 3.2.

-- 
Etan Wexler <mailto:ewexler@stickdog.com>

Received on Saturday, 18 May 2002 09:17:39 UTC