Skip to content

Commit cb6bac6

Browse files
yisibltabatkins
andauthored
[css-color-5] Change the computed value of light-dark() none from linear-gradient(transparent) to image(transparent) (#13897)
* Change the computed value of `light-dark()` none from `linear-gradient(transparent)` to `image(transparent)` * Apply suggestion from @tabatkins --------- Co-authored-by: Tab Atkins Jr. <jackalmage@gmail.com>
1 parent 4aa7954 commit cb6bac6

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

css-color-5/Overview.bs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2808,15 +2808,10 @@ or any other color or monochrome output device which has been characterized.
28082808
if the <a>used color scheme</a> is ''light'' or unknown,
28092809
or the second image,
28102810
if the <a>used color scheme</a> is ''dark''.
2811-
The none keyword
2812-
produces a fully transparent image
2813-
with no natural size.
28142811

2815-
It is equivalent to a single-stop gradient whose stop color is ''transparent''':
2816-
2817-
<pre class="lang-css">
2818-
linear-gradient(transparent)
2819-
</pre>
2812+
The <dfn value for="light-dark()">none</dfn> keyword
2813+
computes to ''image(transparent)''
2814+
(a fully transparent image with no natural size).
28202815

28212816
<div class="example" id="ex-light-dark-color">
28222817
For example, to maintain a legible contrast on links,
@@ -2866,6 +2861,12 @@ or any other color or monochrome output device which has been characterized.
28662861
<pre class="lang-css">
28672862
background-image: light-dark(url(my-light-image.png), none);
28682863
</pre>
2864+
2865+
This is equivalent to:
2866+
2867+
<pre class="lang-css">
2868+
background-image: light-dark(url(my-light-image.png), image(transparent));
2869+
</pre>
28692870
</div>
28702871

28712872

css-images-4/Overview.bs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,11 @@ Image Fallbacks and Annotations: the ''image()'' notation {#image-notation}
395395
one can use this as a simple way to "tint" a background image,
396396
by overlaying a partially-transparent color over the top of the other image:
397397

398-
<pre class="lang-css">background-image: image(rgba(0,0,255,.5)), url("bg-image.png");</pre>
398+
<pre class="lang-css">background-image: image(rgba(0, 0, 255, .5)), url("bg-image.png");</pre>
399+
400+
This is equivalent to a single color stop gradient:
401+
402+
<pre class="lang-css">background-image: linear-gradient(rgba(0, 0, 255, .5)), url("bg-image.png");</pre>
399403

400404
'background-color' does not work for this,
401405
as the solid color it generates always lies <em>beneath</em> all the background images.

css-images-5/Overview.bs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ Image Fallbacks and Annotations: the ''image()'' notation {#image-notation}
201201
one can use this as a simple way to "tint" a background image,
202202
by overlaying a partially-transparent color over the top of the other image:
203203

204-
<pre class="lang-css">background-image: image(rgba(0,0,255,.5)), url("bg-image.png");</pre>
204+
<pre class="lang-css">background-image: image(rgba(0, 0, 255, .5)), url("bg-image.png");</pre>
205+
206+
This is equivalent to a single color stop gradient:
207+
208+
<pre class="lang-css">background-image: linear-gradient(rgba(0, 0, 255, .5)), url("bg-image.png");</pre>
205209

206210
'background-color' does not work for this,
207211
as the solid color it generates always lies <em>beneath</em> all the background images.

0 commit comments

Comments
 (0)