-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathvar-evaluation.html
More file actions
33 lines (31 loc) · 1009 Bytes
/
var-evaluation.html
File metadata and controls
33 lines (31 loc) · 1009 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
33
<!DOCTYPE html>
<title>CSS Container Queries Test: var() in size query values</title>
<link rel="help" href="https://un5n798jx6qx6j0rmf2verhh.julianrbryant.com/css-conditional-5/#size-container">
<link rel="help" href="https://un5n798jx6qx6j0rmf2verhh.julianrbryant.com/mediaqueries-4/#units">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/8088">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/cq-testcommon.js"></script>
<style>
#container {
container-type: size;
width: 200px;
--query: 100px;
--invalid-value: initial;
}
@container (width > var(--invalid-value, var(--query, 500px))) {
#target {
height: 50px;
background-color: green;
}
}
</style>
<div id=container>
<div id=target></div>
</div>
<script>
setup(() => assert_implements_size_container_queries());
test(() => {
assert_equals(getComputedStyle(target).backgroundColor, 'rgb(0, 128, 0)');
}, 'inline-size with var-substitution');
</script>