HTML in dark mode by default on visionOS

My Safari extension has a WKWebView in the main app and an HTML popup window in Safari. For some reason, both are in dark mode on visionOS, even though the device environment is light and Safari tabs are also showing light mode. Why does this happen, and how can I change it?

HTML in dark mode by default on visionOS
 
 
Q