Re: QA: Good CSS class names

I agree that some readers may have trouble understanding the use of the 
word role, but I'm not sure that semantics the right word either. 
Perhaps using the word "intent" or expanding "role" into "role in the 
structure of the document" would help.

I think that "|prettybackground" is a questionable class name. It 
doesn't say how the background is pretty, but it does imply that it has 
something to do with background. Perhaps something more explicit like 
"rosebackground" makes the problem clearer.

You might want to point out that there is another possible solution to 
your |change all light text into dark text| problem. Changing the style. 
This leaves you with the confusing situation where elements of the class 
lighttext are rendered in dark text. This solution doesn't make using 
lighttext as a class name seem like a good idea it, it shows that using 
names such as lighttext can have two results when change is required and 
both are bad.

Hope this helps.

Steve Ferguson - Illumit L.L.C <http://illumit.com/>

|Dominique Hazaël-Massieux wrote:

>Hi Sybren,
>
>Le lun 08/03/2004 à 23:59, Sybren Stüvel a écrit :
>  
>
>>I've written a tip about giving your CSS classes a good name. I hope 
>>you all
>>like the tip, and place it online!
>>    
>>
>
>Thanks for your contribution! I've put the draft on-line:
>http://www.w3.org/QA/Tips/goodclassnames.html
>linked from the Tips page:
>http://www.w3.org/QA/Tips/
>
>hence the review period for it starts today. If anybody has comments on
>it, please send it before March 23rd
>
>Here comes my own feedback:
>- I like the ideas that the draft develops; I think it's a useful
>addition to the tips we already have in place
>- the title refers to "CSS class", whereas the class attribute is part
>of HTML, and can have other usages than simply applying CSS; I would
>therefore suggests changing it from "A CSS class gives an element a
>role" to "Use <code>class</code> with semantics in mind"
>- rather than "role" which is not necessarily easy to understand when
>applied to a language, I propose to use the term "semantics" which is
>well anchored in the languages description
>- it may be worth adding a note that this fits in the more general
>principle of separating content from presentation
>http://www.w3.org/2001/tag/doc/contentPresentation-26.html
>
>Thanks again for your contribution!
>  
>

Received on Tuesday, 9 March 2004 13:02:36 UTC