Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I replace color: windowtext;

Tags:

css

I'm working with an old CSS stylesheet and several of the entries are similar to:

.calibre18 {
  color: windowtext;
  font-family: "Book Antiqua", "serif";
  font-size: 1.29167em;
  line-height: 1.2;
}

This keeps erroring out on color: windowtext; I find that it has been deprecated "in favor of the CSS3 UI appearance property". Unfortunately, that seems to be deprecated as well.

How can I recreate the authors original intent?

like image 373
Deina Underhill Avatar asked Feb 14 '15 02:02

Deina Underhill


1 Answers

The old CSS2 system color names have been deprecated for a couple reasons:

These color names have been deprecated, however, as they are insufficient for their original purpose (making website elements look like their native OS counterparts), and represent a security risk, as it makes it easier for a webpage to "spoof" a native OS dialog.

As seen at http://dev.w3.org/csswg/css-color-4/#system-colors

Another relevant quote:

User agents must support these keywords, but should map them to "default" values, not based on the user’s OS settings (for example, mapping all the "background" colors to white and "foreground" colors to black). Authors must not use these keywords.

IMHO, you shouldn't try to recreate the authors' original intent nor rely on user agents' default support but define actual colors.

like image 127
ala_747 Avatar answered Nov 15 '22 10:11

ala_747