Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-conditional/container-queries/dialog-backdrop-remove.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>CSS Container Queries Test: ::backdrop disappearing conditionally on dialog container</title>
<link rel="match" href="top-layer-dialog-backdrop-ref.html">
<style>
html {
/* Prevent multiple layout passes due to scrollbars */
overflow: hidden;
background: green;
}
dialog {
container-type: size;
width: 100px;
height: 100px;
visibility: hidden;
}
dialog::backdrop {
display: block;
background-color: red;
}
@container (width > 1px) {
dialog::backdrop {
display: none;
}
}
</style>
<dialog id="dialog"></dialog>
<script>
dialog.showModal();
</script>