@@ -34,6 +34,8 @@ spec:css-color-4; type:value; text:srgb
3434spec:css-color-4; type:dfn; text:modern color syntax
3535spec:css-color-4; type:value; text:alpha-value
3636spec:css-values-5; type:value; text:color
37+ spec:css-color-adjust-1; type:value; text:light
38+ spec:css-color-adjust-1; type:value; text:dark
3739</pre>
3840<link rel="stylesheet" href="style.css" />
3941<style>
@@ -102,8 +104,8 @@ Introduction {#intro}
102104 and two colors with visually different lightness,
103105 like yellow and blue, can have the same HSL lightness).
104106
105- This module adds a new function:
106- ''color-mix()'' ,
107+ This module adds the new functions
108+ ''color-mix()'' and ''light-dark()'' ,
107109 and extends existing ones with [[#relative-colors|relative color syntax]] .
108110
109111 It also extends the ''color()'' function
@@ -121,7 +123,7 @@ Introduction {#intro}
121123 Colors in CSS are represented by the <dfn export><<color>></dfn> type:
122124
123125 <pre class='prod'>
124- <color> = <<absolute-color-base>> | currentcolor | <<system-color>> | <<device-cmyk()>>
126+ <color> = <<absolute-color-base>> | currentcolor | <<system-color>> | <<device-cmyk()>> | <<light-dark()>>
125127
126128 <dfn><absolute-color-base></dfn> = <<hex-color>> | <<absolute-color-function>> | <<named-color>> | transparent
127129 <dfn><absolute-color-function></dfn> = <<rgb()>> | <<rgba()>> |
@@ -2468,6 +2470,22 @@ or any other color or monochrome output device which has been characterized.
24682470 <li> alpha is the same as the input color
24692471 </ul>
24702472
2473+ <h2 id="light-dark">
2474+ Reacting to the used color-scheme: the ''light-dark()'' Function
2475+ </h2>
2476+
2477+ System colors have the ability to react to the current used ''color-scheme'' value.
2478+ The ''light-dark()'' function exposes the same capability to authors.
2479+
2480+ <pre class='prod'>
2481+ <dfn export>light-dark()</dfn> = light-dark( <<color>> , <<color>> )
2482+ </pre>
2483+
2484+ This function computes to the computed value of the first color,
2485+ if the <a>used color scheme</a> is ''light'' or unknown,
2486+ or to the computed value of the second color,
2487+ if the <a>used color scheme</a> is ''dark'' .
2488+
24712489<!--
24722490████ ██ ██ ████████ ████████ ████████ ████████ ███████ ██ ███ ████████ ████████
24732491 ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
0 commit comments