summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/container-queries/inline-size-and-min-width.html
blob: 8ddcbc614cae184b65295ab722ce392df4491f5d (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
<!doctype html>
<title>CSS Container Queries Test: query of inline-size container is affected by min-width property</title>
<link rel="help" href="https://drafts.csswg.org/css-contain-3/#container-queries">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/cq-testcommon.js"></script>
<style>
  #container {
    container-type: inline-size;
    min-width: 200px;
    width: fit-content;
  }
  @container (min-width: 200px) {
    #child { color: green }
  }
</style>
<div id="container">
  <div id="child">Green</div>
</div>
<script>
  setup(() => assert_implements_container_queries());

  test(() => {
    assert_equals(getComputedStyle(child).color, "rgb(0, 128, 0)");
  }, "min-width of inline-size container affects container size");
</script>