Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>@container: scroll-state(snapped: none)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/css-conditional/container-queries/support/cq-testcommon.js"></script>
<style>
#no-snap { container-type: scroll-state; }
@container scroll-state(snapped: none) {
#target { --snapped-none: true }
}
@container not scroll-state(snapped) {
#target { --snapped-boolean: true }
}
</style>
<div id="no-snap">
<div id="target"></div>
</div>
<script>
setup(() => assert_implements_scroll_state_container_queries());
test(() => {
assert_equals(getComputedStyle(target).getPropertyValue("--snapped-none"), "true");
assert_equals(getComputedStyle(target).getPropertyValue("--snapped-boolean"), "true");
}, "Check scroll-state(snapped:none) and scroll-state(snapped) for non-snapping container");
</script>