Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!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>