How to disable scrolling the page behind a dialog element
Here’s how you can disable scrolling of the page behind a dialog element using :has()
selector. Courtesy of this tweet by Adam Argyle.
html:has(dialog[open]) {
overflow: hidden;
}