Change theme js

Is there a script so user can change Theme ligt/dark by clicking on it,
im using the alien-night-discourse theme and they have the option to click on the sun or moon to change it but it doesnt change the theme only the background, here is the JS

<script async>
$(document).ready(function() {
	var darkTheme = localStorage.getItem("theme");
	if (darkTheme !== null){
	if (typeof(Storage) !== "undefined") {
		// Code for localStorage/sessionStorage.
		$('.theme-switcher-dark').on('click', function() {
			localStorage.setItem("theme", "dark");
		$('.theme-switcher-light').on('click', function() {
	} else {
		// Sorry! No Web Storage support..
		console.log('Upgrade to a better browser! Really!')

Did you have no luck with the Theme guide here? You should consider posting there to grab the attention of those already on that Topic (and it’s better board etiquette in any case?).