summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-images/gradient/color-scheme-dependent-color-stops.html
blob: f95a557703cddd0a629c4f853df618462d368114 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<link rel="author" title="Aditya Keerthi" href="https://github.com/pxlcoder">
<link rel="help" href="https://www.w3.org/TR/css-color-adjust-1/#color-scheme-prop">
<link rel="help" href="https://www.w3.org/TR/css-color-4/#css-system-colors">
<link rel="help" href="https://www.w3.org/TR/css-color-5/#light-dark">
<link rel="help" href="https://www.w3.org/TR/css-color-5/#color-mix">
<title>Test changing used color-scheme updates gradient with color-scheme dependent color stops.</title>
<link rel="match" href="color-scheme-dependent-color-stops-ref.html">
<style>

.dark {
    color-scheme: dark;
}

.box {
    width: 100px;
    height: 100px;
}

#system-color {
    background-image: linear-gradient(CanvasText, CanvasText);
}

#system-color-in-color-mix {
    background-image: linear-gradient(color-mix(in lch, Canvas, pink), color-mix(in lch, Canvas, pink));
}

#light-dark {
    background-image: linear-gradient(light-dark(red, green), light-dark(red, green));
}

#light-dark-in-color-mix {
    background-image: linear-gradient(color-mix(in lch, light-dark(red, green), pink), color-mix(in lch, light-dark(red, green), pink));
}

</style>
</head>
<body>
<p>Test system color</p>
<div id="system-color" class="box"></div>
<p>Test system color in color-mix()</p>
<div id="system-color-in-color-mix" class="box"></div>
<p>Test light-dark()</p>
<div id="light-dark" class="box"></div>
<p>Test light-dark() in color-mix()</p>
<div id="light-dark-in-color-mix" class="box"></div>
<script>

requestAnimationFrame(() => {
    document.querySelectorAll(".box").forEach((box) => {
        box.classList.add("dark");
    });

    document.documentElement.className = '';
});

</script>
</body>
</html>