-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathcurrentcolor-005.html
More file actions
43 lines (41 loc) · 1.6 KB
/
currentcolor-005.html
File metadata and controls
43 lines (41 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<title>column-rule-color that depend on currentcolor should be recomputed when currentcolor changes</title>
<link rel="match" href="currentcolor-005-ref.html">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#resolving-other-colors">
<style>
#column-rule-color-currentcolor {
columns: 2;
column-rule-style: solid;
column-rule-width: 10px;
height: 1em;
column-rule-color: currentcolor;
}
#column-rule-color-color-mix-currentcolor {
columns: 2;
column-rule-style: solid;
column-rule-width: 10px;
height: 1em;
column-rule-color: color-mix(in hsl, currentcolor 50%, white);
}
</style>
</head>
<body>
<div id="column-rule-color-currentcolor">XXX<br>YYY</div>
<div id="column-rule-color-color-mix-currentcolor">XXX<br>YYY</div>
<script>
// Use double requestAnimationFrame to remove need of setTimeout.
// Wait for the first frame to ensure that the style is computed.
requestAnimationFrame(() => {
// Wait for the second frame to ensure that the style is painted.
requestAnimationFrame(() => {
document.getElementById("column-rule-color-currentcolor").style.color = "green";
document.getElementById("column-rule-color-color-mix-currentcolor").style.color = "green";
document.documentElement.classList.remove("reftest-wait");
});
});
</script>
</body>
</html>