Hi, and sorry for the trouble. I couldn’t reproduce either problem on a clean install of 5.2.0 in Chrome and Firefox. The dark mode icon shows once and the pages load normally. So I need a few details to find what is different on your site.
- Do you use a child theme? Version 5.2.0 prints the header once and has a new header structure. If your child theme has its own copy of
header.php or template-parts/header/navigation.php from 5.1.x, the old and new markup can both print. That shows the dark mode icon twice. To fix it, delete those two files from the child theme, or copy the new versions from the parent theme and re-apply your changes.
- Do you use a caching, minify or optimisation plugin, or a CDN? Please clear all of them after updating, then test again in a private window.
Rolling back to 5.1.8 is fine in the meantime. Thanks for reporting it.