Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<title>CSS Container Queries Test: var() in size query values</title>
<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>