summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-color/light-dark-currentcolor-in-color.html
blob: 7a95ea0b8ffc00c93f3776e57145ffa67aad3f3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!doctype html>
<meta charset="utf-8">
<title>CurrentColor can be used inside light-dark for the color property</title>
<link rel="help" href="https://drafts.csswg.org/css-color-5/#light-dark">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
  #parent { color: green; }
  #child {
    color-scheme: dark;
    color: light-dark(red, currentColor);
  }
</style>
<div id="parent">
  <div id="child">Text should be green</div>
</div>
<script>
  test(() => {
    assert_equals(getComputedStyle(child).color, "rgb(0, 128, 0)");
  }, "curentColor in light-dark() refers to parent color");
</script>