Skip to content

Commit ed21afd

Browse files
authored
[css-color-adjust-1] Rework color scheme stuff to reflect f2f resolutions (#13857)
* [css-color-adjust-1] Rework the color-scheme section to use the concepts of 'page color scheme' and 'element color scheme', deferring as much as possible to the page color scheme, in preparation for adjusting the behavior of the MQ. #13377 * [css-color-adjust-1] Move and fix up examples. #13377 * [css-color-adjust-1][mediaqueries-5] Specify that *all* embedded documents use the embedding element's color scheme. #7213 #7493 * [mediaqueries-5] Switch (prefers-color-scheme) to use the page color scheme. Add (ua-color-scheme) to reflect the user's actual preference. #13377 * [css-color-4][css-color-5] Use the new correct term for an element's color scheme. * [css-color-5][editorial] Fix indentation. * ws
1 parent cb6bac6 commit ed21afd

4 files changed

Lines changed: 363 additions & 241 deletions

File tree

css-color-4/Overview.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ System Colors</h3>
19271927

19281928
To maintain legibility,
19291929
the <<system-color>> keywords also respond to
1930-
the [=used color scheme=].
1930+
the [=element color scheme=].
19311931

19321932

19331933
<div class="example" id="ex-LM-DM-links">

css-color-5/Overview.bs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,7 +2781,7 @@ or any other color or monochrome output device which has been characterized.
27812781
Reacting to the used color-scheme: the ''light-dark()'' Function
27822782
</h2>
27832783

2784-
System colors have the ability to react to the current used ''color-scheme'' value.
2784+
[=System colors=] have the ability to react to an element's [=color scheme=].
27852785
The ''light-dark()'' function exposes the same capability to authors.
27862786

27872787
There are two forms of this function: one takes a pair of colors
@@ -2800,14 +2800,14 @@ or any other color or monochrome output device which has been characterized.
28002800
</pre>
28012801

28022802
For the color form, this function computes to the computed value of the first color,
2803-
if the <a>used color scheme</a> is ''light'' or unknown,
2803+
if the <a>element color scheme</a> is ''light'',
28042804
or to the computed value of the second color,
2805-
if the <a>used color scheme</a> is ''dark''.
2805+
if the <a>element color scheme</a> is ''dark''.
28062806

28072807
For the image form, this function returns the first image,
2808-
if the <a>used color scheme</a> is ''light'' or unknown,
2808+
if the <a>element color scheme</a> is ''light'',
28092809
or the second image,
2810-
if the <a>used color scheme</a> is ''dark''.
2810+
if the <a>element color scheme</a> is ''dark''.
28112811

28122812
The <dfn value for="light-dark()">none</dfn> keyword
28132813
computes to ''image(transparent)''
@@ -2833,41 +2833,41 @@ or any other color or monochrome output device which has been characterized.
28332833
is used in dark mode.
28342834
(WCAG contrast 13.28:1, AAA pass).
28352835

2836-
<div style="margin:1em; margin-left: 2em; text-decoration: underline; background: inherit">
2837-
<p style="padding: 4px; background-color: white; color: blue"> Legible link text</p>
2838-
<p style="padding: 4px; background-color: black; color: blue"> Illegible link text</p>
2839-
<p style="padding: 4px; background-color: black; color: #81D9FE"> Legible link text</p>
2840-
</div>
2836+
<div style="margin:1em; margin-left: 2em; text-decoration: underline; background: inherit">
2837+
<p style="padding: 4px; background-color: white; color: blue"> Legible link text</p>
2838+
<p style="padding: 4px; background-color: black; color: blue"> Illegible link text</p>
2839+
<p style="padding: 4px; background-color: black; color: #81D9FE"> Legible link text</p>
28412840
</div>
2841+
</div>
28422842

2843-
<div class="example" id="ex-light-dark-image">
2844-
For example, to provide easily visible list bullets
2845-
for light mode and dark mode:
2843+
<div class="example" id="ex-light-dark-image">
2844+
For example, to provide easily visible list bullets
2845+
for light mode and dark mode:
28462846

2847-
<pre class="lang-css">
2848-
ul.fancy {
2849-
list-style-image: light-dark(
2850-
url("icons/deep-maroon-ball.png"),
2851-
url("icons/pale-yellow-star.png")
2852-
);
2853-
}
2854-
</pre>
2855-
</div>
2847+
<pre class="lang-css">
2848+
ul.fancy {
2849+
list-style-image: light-dark(
2850+
url("icons/deep-maroon-ball.png"),
2851+
url("icons/pale-yellow-star.png")
2852+
);
2853+
}
2854+
</pre>
2855+
</div>
28562856

2857-
<div class="example" id="ex-light-dark-none">
2858-
For example, a raster image is used in light mode,
2859-
while in dark mode we want a fully-transparent image.
2857+
<div class="example" id="ex-light-dark-none">
2858+
For example, a raster image is used in light mode,
2859+
while in dark mode we want a fully-transparent image.
28602860

2861-
<pre class="lang-css">
2862-
background-image: light-dark(url(my-light-image.png), none);
2863-
</pre>
2861+
<pre class="lang-css">
2862+
background-image: light-dark(url(my-light-image.png), none);
2863+
</pre>
28642864

2865-
This is equivalent to:
2865+
This is equivalent to:
28662866

2867-
<pre class="lang-css">
2868-
background-image: light-dark(url(my-light-image.png), image(transparent));
2869-
</pre>
2870-
</div>
2867+
<pre class="lang-css">
2868+
background-image: light-dark(url(my-light-image.png), image(transparent));
2869+
<pre>
2870+
</div>
28712871

28722872

28732873

0 commit comments

Comments
 (0)