You can use the ::backdrop pseudo-element to style the backdrop of modal dialogs and elements which have been placed in fullscreen mode using the Fullscreen API.

::backdrop {
  background-color: rgb(0 0 0 / 0.5);
}
yo!

You don't have to limit yourself to semi-transparent background color.

::backdrop {
  background: conic-gradient(red, orange, yellow, green, red);
  outline: 20px solid white;
  outline-offset: -20px;
}
yo!

My blog doesn't support comments yet, but you can reply via blog@matuzo.at.