[drupal-devel] [bug] Zebra stripe table CSS class names are badly chosen

Steven drupal-devel at drupal.org
Wed Jun 15 22:12:08 UTC 2005


Issue status update for http://drupal.org/node/25067

 Project:      Drupal
 Version:      4.6.0
 Component:    base system
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Thox
 Updated by:   Steven
 Status:       patch

I'd prefer "odd"/"even" than ""/"alt". It is more descriptive.




Steven



Previous comments:
------------------------------------------------------------------------

June 15, 2005 - 15:58 : Thox

Attachment: http://drupal.org/files/issues/zebra-classnames.patch (1.41 KB)

The CSS class names chosen for table rows are badly chosen: "light" and
"dark". Since CSS could be used to make the "dark" rows light and the
"light" rows dark, the names are wrong. The attached patch changes
"light" and "dark" to "odd" and "even".


In the future, all class names should describe /why/ an element is
styled differently, not /how/ it is to be styled. e.g. "Red" is a bad
class name, "important" is far better.




------------------------------------------------------------------------

June 15, 2005 - 17:37 : Bèr Kessels

themes/bluemarine/style.css:13:tr.dark td, tr.light td {
themes/pushbutton/style.css:27:tr.dark td, tr.light td {
themes/pushbutton/style.css:512:#tracker tr.light, #tracker tr.dark {
themes/pushbutton/style.css:542:#forum tr.dark {


are core styles still using dark and light. jsut a quick grep.
but other than that a +1 for these better named classes.




------------------------------------------------------------------------

June 15, 2005 - 20:37 : drumm

I have a 80% finished patch on my Drupal checkout which:


- Adds <thead> and <tbody>
- Allows use of <th> in the table body.
- Unifies the classing for the block admin and permissions tables. (I
might codify this in a themeable function.)
- Removes the light class and changes the dark class to alt.
- Adds a class to the <table> tag made by theme_table() to avoid
styling conflicts with layout tables found in some themes.


Many of these changes were suggested by Chris [1].


I will be able to finish and post this patch in some number of weeks.
Please don't worry aobut submitting conflicting patches, I can deal
with it. Although we might want to decide upon odd/even and alt/[none]
classing now.
[1] http://factoryjoe.com/blog/







More information about the drupal-devel mailing list