Having successfully employed this technique to implement a client-side light/dark theme switching feature, I have one observation that others might find helpful: other than the page load "flash" Johan Fredrik Varen mentioned, the only other issue is that the Darkly theme uses slightly different size metrics to the default Bootstrap theme. So when the theme switches some page components are resized, which makes it appear that more than a light/dark switch has occurred. I have found that switching between Lightly and Darkly avoids any component resizing.