Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-conditional/container-queries/style-query-document-element.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Container Queries Test: style query against document element</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/cq-testcommon.js"></script>
<style>
html {
--foo: bar;
}
@container style(--foo: bar) {
body { color: green; }
}
</style>
<body id="body">
<script>
test(() => {
assert_equals(getComputedStyle(body).color, "rgb(0, 128, 0)");
}, "style query should evaluate to true");
</script>