Common pattern: add a class when the dialog opens, remove it when the dialog closes.
Print dialog open → yellow print-mode from beforeprint. After close → afterprint restores screen.
Lines: 0 | Characters: 0