I've read that the same tech stack is intended to be used for Lemmy. Given how impressive the performance of the linked site is, it suggests very promising things for when it's implemented.
It uses the browser preference for light/dark theme by default. After you click the theme toggle on the site, it keeps using that chosen theme by storing it in a cookie.
In my opinion, it is way better to implement theme switching on the client side. The prefers-color-scheme media query is better supported across browsers and allows reacting to a change of the user's system preferences.