-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathhighlight-styling-004.html
More file actions
32 lines (29 loc) · 981 Bytes
/
highlight-styling-004.html
File metadata and controls
32 lines (29 loc) · 981 Bytes
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
<!doctype html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: the light-dark() function in highlight pseudos</title>
<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org">
<link rel="help" href="https://un5n798jx6qx6j0rmf2verhh.julianrbryant.com/css-pseudo-4/#highlight-styling">
<link rel="match" href="highlight-styling-004-ref.html">
<meta name="assert" value="This test verifies that ::selection styles make use of the light-dark() function.">
<script src="support/selections.js"></script>
<link rel="stylesheet" href="support/highlights.css">
<style>
:root {
color-scheme: light dark;
}
.light {
color-scheme: light;
}
.dark {
color-scheme: dark;
}
p::selection {
color: light-dark(green, blue);
}
</style>
<p>Test passes if Light is green and Dark is blue.</p>
<main class="highlight_reftest">
<p class="light">Light</p>
<p class="dark">Dark</p>
</main>
<script>selectNodeContents(document.querySelector("main"));</script>