W3C home > Mailing lists > Public > www-style@w3.org > September 2002

user preferences for colors (was Re: CSS 2.1 WD and non-CSS presentational hints)

From: Tantek Çelik <tantek@cs.stanford.edu>
Date: Thu, 05 Sep 2002 15:00:00 -0700
To: Ian Hickson <ian@hixie.ch>, "L. David Baron" <dbaron@fas.harvard.edu>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <B99D21CE.168D6%tantek@cs.stanford.edu>

On 9/5/02 11:37 AM, "Ian Hickson" <ian@hixie.ch> wrote:

> 
> On Thu, 5 Sep 2002, L. David Baron wrote:
>> 
>> Well, it has less to do with that than the idea that we want user
>> preferences to be expressable as a user stylesheet, and therefore things
>> like the color-related attributes on BODY would stop working given this
>> change.
> 
> If it is only colours, then the point is moot, since we have already moved
> to a world where the user pref colours are assigned to keywords rather
> than appearing as rules in the user stylesheet.

We have not yet "moved to a world" as such.  Those features have only been
proposed in a public draft for the first time in the CSS3 Color module last
call working draft:

 http://www.w3.org/TR/css3-color/#css3-user

ActiveHyperlink
 Active hyperlink background.
ActiveHyperlinkText
 Text of an active hyperlink.
HoverHyperlink
 Hover hyperlink background.
HoverHyperlinkText
 Text of a hyperlink in the hover state.
Hyperlink
 Hyperlink background.
HyperlinkText
 Hyperlink text. 
VisitedHyperlink
 Visited hyperlink background.
VisitedHyperlinkText
 Text of a visited hyperlink.

Given this entire thread of discussion, I'm not convinced that this is the
right way to solve the problem of expressing user preferences for link
colors.  There were also several last call comments saying as much, and
going on to say that there needed to be even better/more user control over
color.

For example, it could easily be said that user's preferences for colors in
the preference UI for a user agent should simply be converted to style rules
that are prepended to the user's user style sheet, e.g. if the user has
chosen "blue" for their link color, "green" for visited links, "red" for
active links and "lime" for hovered links, these should be converted by the
user agent to the following rules, to be prepended to the user's user style
sheet.

:link { color:blue }
:visited { color:green }
:link:hover,:visited:hover { color:lime }
:link:active,:visited:active { color:red }

And that would be sufficient to express what the above user hyperlink colors
express.  Add 'background-color' declarations to set those respectively.

But what do user agents do for if they provide a user interface to allow the
user to SEPARATELY set the color of hovered links vs. hovered visited links?
E.g. given the previous example, the user may want to choose "aqua" for
hovered links, and "lime" only for hovered visited links.  These preferences
would then not be expressible without adding new system color keywords,
however, they would easily be expressible by changing/adding style rules:

:link { color:blue }
:link:hover { color:aqua }

:visited { color:green }
:visited:hover { color:lime }

:link:active,:visited:active { color:red }


Thus I think we should drop the new color keywords for user hyperlink color
preferences from the CSS3 Color module, and instead add some informative
text about expressing user preferences for color using synthesized style
rules that may be prepended to the user's user style sheet.

An additional advantage of this system of synthesized rules over hyperlink
color keywords, is that it precisely explains how the user's preferences in
the UI of the user agent interact with the user's own style rules in their
user style sheet.  Easy answer: they cascade, and since the user's own style
rules always follow the synthesized rules, the user's own style rules "win"
(as long as they have greater specificity etc.).

There have also been some last call comments asking to deprecate all the
(CSS2) system colors, and given that those colors are becoming less and less
capable of expressing what modern user interfaces do, I am starting to
agree.

Tantek
Received on Thursday, 5 September 2002 17:50:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:16 GMT