Themes: avoid clashes with system colors

Mental - January 24, 2008 - 12:28
Project:Drupal
Version:6.x-dev
Component:Garland theme
Category:bug report
Priority:normal
Assigned:Unassigned
Status:patch (code needs review)
Description

I'm not sure, whether this is garland-specific.

Anyway, when you set the "color" of an input field, please also set it's "background-color" (and vice versa). Otherwise the background color of the input (and select) fields is set by the web browser to a color which is usually OS theme-specific. Using an OS theme where the input controls are painted dark or black, black text in them remains invisible. I'm even writing this bug report into drupal.org practically blindfoldedly.

AttachmentSize
Sample screenshot54.24 KB

#1

Mental - February 24, 2008 - 16:35
Version:5.6» 6.0

Changed version: 5.6 -> 6.0. Issue still occurs.

#2

Mental - February 24, 2008 - 18:13
Status:active» patch (code needs review)

Here's a trivial patch to fix this in the Garland theme and probably avoid some W3C CSS validation warnings about this issue. Anybody alive?

AttachmentSize
The patch.409 bytes

#3

Mental - May 1, 2008 - 12:28
Version:6.0» 6.2

Still occurs in Drupal 6.2.

#4

Rowanw - May 2, 2008 - 12:15
Title:Invisible text in input fields» Input fields: avoid clashes with system colors
Version:6.2» 6.x-dev

It took me a while to realize what the problem was, but it's definitely a legitimate issue. When you set the foreground color of an element the background color should be specified at the same time, you can't guarantee that the background will always stay the same color across all devices and systems.

I haven't tested this patch but it looks good. Mental, can you make sure all the other core themes get the same treatment?

#5

Mental - May 2, 2008 - 14:40

Ok, this will do for the Chameleon and Garland (and Minnelli?) themes on the screen. However, Garland also has a print.css for print media, and I can't promise that it will work properly for printing. Analyzing and rewriting the whole theme - I don't have the time. Where are your theme developers?

Some more remarks - Garland was the only theme always using custom input field colors. Chameleon only coloured the erronous input fields, which still produced this issue, so I changed it to handle all the input fields. The other themes don't specify custom colours for the input fields and therefore these just look ugly when using some dark-coloured system colour schemes, but they are still readable.

AttachmentSize
New patch896 bytes

#6

Rowanw - May 3, 2008 - 01:22
Title:Input fields: avoid clashes with system colors» Themes: avoid clashes with system colors

I noticed that the Chameleon theme didn't have a background or foreground color on the body element, which is a big problem (the whole page changes color). I've created a new patch for this.

I also found a nice dark Ubuntu theme that I've decided to keep, however as Mental already pointed out, the d.org theme becomes much harder to use (I'm using a custom Human theme).

AttachmentSize
theme_vs_system.patch1.9 KB
 
 

Drupal is a registered trademark of Dries Buytaert.