Skip to content

Commit a49cf8f

Browse files
committed
[css-color-4] Add example, wpt for resolving currentColor w3c#1510
1 parent 3b0c9d8 commit a49cf8f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

css-color-4/Overview.bs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5467,6 +5467,42 @@ Resolving values of the ''color()'' function</h3>
54675467
not as the value of the 'color' property,
54685468
so descendants will use their own 'color' property to resolve it.
54695469

5470+
<div class="example" id="ex-currentcolor-resolve">
5471+
For example, given this html:
5472+
5473+
<pre class="lang-html">
5474+
&lt;div>
5475+
&lt;p>Assume this example text is long enough
5476+
to wrap on multiple lines.
5477+
&lt;/p>
5478+
&lt;/div>
5479+
</pre>
5480+
5481+
and this css:
5482+
5483+
<pre class="lang-css">
5484+
div {
5485+
color: <span class="swatch" style="--color: forestgreen"></span> forestgreen;
5486+
text-shadow: currentColor;
5487+
}
5488+
p {
5489+
color: <span class="swatch" style="--color: mediumseagreen"></span> mediumseagreen;
5490+
}
5491+
p::firstline {
5492+
color: <span class="swatch" style="--color: yellowgreen"></span> yellowgreen;
5493+
}
5494+
</pre>
5495+
5496+
The value of the inherited property text-shadow
5497+
on the first line fragment would be yellowgreen.
5498+
</div>
5499+
5500+
<wpt>
5501+
currentcolor-001.html
5502+
currentcolor-002.html
5503+
currentcolor-003.html
5504+
</wpt>
5505+
54705506
<!--
54715507
██████ ████████ ████████ ████ ███ ██
54725508
██ ██ ██ ██ ██ ██ ██ ██ ██

0 commit comments

Comments
 (0)