RE: Class Selectors Extension Proposals

Interesting indeed. c(50%,red) is like calling a constructor function
with parameters. This will make CSS somewhat functional (it's like
calling JavaScript functions) and may overlap with the long awaited
behaviors.
I thought we wanted CSS to become more OO like...
I would find inheritance more useful (as I've posted before):

.abstractClass{
/* lots of properties here */
}

.newClass
{
Inherit:abstractClass;
}

Besides, style attributes are becoming extinct.

Cheers,

Manos



-----Original Message-----
From: Daniel Glazman [mailto:glazman@netscape.com] 
Sent: Thursday, May 16, 2002 2:32 PM
To: Alberto Pacheco
Cc: www-style@w3.org
Subject: Re: Class Selectors Extension Proposals


Alberto Pacheco wrote:

Does CSS support the following class descriptors functionality?

1) Adding classes
    Let be
        .a { p1; }
        .b { p2; }
    How do I get ".c {.a + .b}"  or "<span class=a+b>"
    Where class c combines a & b classes properties, ie equivalent to
".c { p1; p2; }"

Just write <span class="a b">.

 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.
Anyway, I think it deserves to be added to the CSS Suggestions List, if
it is still active. Bert, what do you think ?

</Daniel>

-- 
Daniel Glazman  - Netscape Communications Corp. -  glazman@netscape.com
http://people.netscape.com/glazman            AIM:glazou2000 IRC:glazou
http://cascades.mozdev.org          CaScadeS, just a question of styles

Received on Thursday, 16 May 2002 07:44:11 UTC