How to replace color: windowtext;

I am working with an old CSS stylesheet, and several entries are similar to:

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

This results in an error on color: windowtext; I believe it is deprecated "in favor of the CSS3 UI appearance property". Unfortunately, this is also considered obsolete.

How can I recreate the original intentions of the authors?

+6
source share
1 answer

The old CSS2 color names are deprecated for several reasons:

These color names were outdated, however, since they were insufficient for their original purpose (which makes website elements look like their native OS mappings) and pose a security risk because it simplifies the fake web page, a native OS dialog box.

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

Another relevant quote:

User agents must support these keywords, but must match them with the default values, and not based on user OS settings (for example, displaying all the colors of the "background" on white and the "foreground" on black). Authors should not use these keywords.

IMHO, you should not try to recreate the original intent of the authors and not rely on the default support of user agents, but define the actual colors.

+4
source

Source: https://habr.com/ru/post/982477/


All Articles