[whatwg] Predefined classes are gone

Le 2007-05-17 ? 12:22, Adrienne Travis a ?crit :

> A lot of us loved the IDEA of predefined "classes", but didn't like  
> the idea of confusing THAT mechanism with the CSS class mechanism.

Personally, I really don't like thinking of class="" exclusively as a  
mechanism to associate styles. The fact that CSS makes it easy to  
select on a class name doesn't mean that class names are targeted at  
CSS. Predefined class names made that clear, now it's less clear.

While not much in favor at first, I started to like the idea of  
predefined class names after a while. What I like is that it doesn't  
try reinvent a new parallel mechanism for what class *should have  
been* from the start. I think the initial idea was that the class  
attribute would cover the the semantics while CSS the presentation of  
those semantics. The only problem is that earlier specs left those  
semantics undefined, with no way to define them unambiguously. This  
explains why many people, including some standard advocates, started  
thinking of class as a way to attach style rules of the same name to  
their elements (basically making class presentational).

So either we fix class, or we create a new attribute (role) (and  
leave class as a purely presentational hook for CSS? Hurk!). The  
advantage of class is that it's a lot easier to use in CSS selectors,  
making authors more likely to use them. The advantage of role is that  
it begins in a clean state, which could mean less false-positive --  
I'm not sure this will stay true in the long run however, especially  
if people see role as "more semantic" than class and start to use it  
inconsiderably...

I'd tend to think there are use cases where class is most appropriate  
and others where it'd be better to start with a clean new attribute  
(role), but that's just a general feeling based on everything I've  
seen to date.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/

Received on Thursday, 17 May 2007 10:38:32 UTC