<!doctype html>
<title>CSS Container Queries Test: ::backdrop disappearing conditionally on dialog container</title>
<link rel="help" href="https://drafts.csswg.org/css-conditional-5/#container-queries">
<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>