Re: Rationale for the warning "Same colors for color and background-color in two contexts"?

4.10.2011 23:01, Philip TAYLOR (Webmaster, Ret'd) wrote:

>> a { color: black; }
>> b { background: black; }
>
> Well. Isn't it simply the case that we are discussing
> CSS, rather than CSS embedded in HTML, and therefore
> the CSS validator can have no knowledge as to whether
> an <a> element will be embedded in a <b> element, and
> therefore seeks to warn the user that such a usage
> would be ill-advised ?

The CSS validator surely needs to deal with CSS in general, without 
information about the meanings of elements or their allowed or actual 
nesting. But if the warning is based on speculation on possible nesting 
and the possible effects of background transparency, I'm afraid it goes 
far too far. Are there any real problems that have been detected thanks 
to these warnings? I'm pretty sure there are many more problems 
(confusion among authors) _caused_ by the warnings.

In any case, if these warnings are issued, they should be explained in 
the CSS Validator FAQ or in other documentation.

> http://web-consultants.org.uk/sites/tests/colour-test.html
>
> However, I should report that that page, when validated,
> does /not/ throw up the warning that you report, at least
> by default :
>
> http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fweb-consultants.org.uk%2Fsites%2Ftests%2Fcolour-test.html

Oddly enough, if I go to http://jigsaw.w3.org/css-validator/ and either 
enter your URL in the "By URI" dialog or copypaste its content into the 
"By direct input" dialog, without changing the defaults, I do get the 
warning. And I checked that in "More Options", Warnings are set to 
"Normal report".

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Received on Tuesday, 4 October 2011 20:29:42 UTC