Skip to content

Commit 806c43e

Browse files
committed
[css-color-adjust-1] Make color forcing a used-value time operation. #4915
1 parent 69e0dc1 commit 806c43e

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

css-color-adjust-1/Overview.bs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ Properties Affected by Forced Colors Mode {#forced-colors-properties}
348348
<li>'background-color'
349349
</ul>
350350

351-
if its [=computed value=] would be a color other than a [=system color=],
352-
it is instead forced to a [=system color=] as follows:
351+
if its [=computed value=] is a color other than a [=system color=],
352+
its [=used value=] is forced to a [=system color=] as follows:
353353

354354
* If the color value indicates a “fallback” color
355355
(as in the ''color()'' function in [[CSS-COLOR-5]])
@@ -370,6 +370,27 @@ Properties Affected by Forced Colors Mode {#forced-colors-properties}
370370
whenever all of the element’s affected properties
371371
are likewise UA-determined.
372372

373+
<div class="note">
374+
UAs need to be careful about inheritance when forcing colors.
375+
For example,
376+
suppose the UA’s button 'color' and 'background-color'
377+
are the opposite of its canvas 'color' and 'background-color'.
378+
Given markup such as
379+
380+
<xmp highlight=html>
381+
<button>Push <em>this</em> button</button>
382+
</xmp>
383+
384+
Normally, <{em}> will inherit from <{button}>,
385+
ensuring its readability.
386+
However in [=forced colors mode=],
387+
the 'color' of both <{button}> and <{em}> will need to be forced.
388+
It's easy to see that <{button}>’s color should be forced to the button color,
389+
but <{em}> also needs to be forced to the button color;
390+
if it were forced to the canvas 'color' like it is everywhere else in the document,
391+
its text will be unreadable.
392+
</div>
393+
373394
Additionally:
374395
* 'box-shadow' and 'text-shadow' compute to to ''box-shadow/none''
375396
* 'background-image' computes to ''background-image/none''

0 commit comments

Comments
 (0)