Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /css/css-view-transitions/scoped/crashtests/container-query.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<html class="test-wait">
<style>
  #container {
    width: 100px;
    container-type: inline-size;
  }
  @container (width > 200px) {
    #target { background-color: green }
  }
</style>
<div id="container">
  <div id="target">
    <div id="scope">Scope</div>
  </div>
</div>
<script>
  onload = async () => {
    await scope.startViewTransition(() => {
      container.style.width = "300px";
    }).ready;
    document.documentElement.classList.remove("test-wait");
  };
</script>