Skip to content

Commit 1e166b9

Browse files
committed
[css-color-4] system colors have meaning outside forced-colors, reflect light and dark mode #4883
1 parent 8b57731 commit 1e166b9

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

css-color-4/Overview.bs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,29 @@ Note: The history of the X11 color system is interesting,
925925
<h3 id="css-system-colors" dfn lt="system colors">
926926
System Colors</h3>
927927

928-
In [=forced colors mode=],
928+
In general, the <<system-color>> keywords
929+
reflect <em>default</em> color choices made by the user, the browser, or the OS.
930+
They are typically used in the brwser default stylesheet, for this reason.
931+
932+
To maintain legibility,
933+
the <<system-color>> keywords also respond to light mode or dark mode changes.
934+
935+
936+
<div class="example" id="LM-DM-links">
937+
For example, traditional blue link text is legible on a white background
938+
(WCAG contrast 8.59:1, AAA pass)
939+
but would not be legible on a black background
940+
(WCAG contrast 2.44:1, AA fail).
941+
Instead, a lighter blue such as #81D9FE would be used in dark mode
942+
(WCAG contrast 13.28:1, AAA pass).
943+
<div style="margin:1em; margin-left: 2em; text-decoration: underline; background: inherit">
944+
<p style="padding: 4px; background-color: white; color: blue"> Legible link text</p>
945+
<p style="padding: 4px; background-color: black; color: blue"> Illegible link text</p>
946+
<p style="padding: 4px; background-color: black; color: #81D9FE"> Legible link text</p>
947+
</div>
948+
</div>
949+
950+
However, in [=forced colors mode=],
929951
most colors on the page are forced into a restricted, user-chosen palette.
930952
The <dfn>&lt;system-color></dfn> keywords
931953
expose these user-chosen colors

0 commit comments

Comments
 (0)