You can use the CSS :has pseudo-class to create a functioning dark mode option in css only without any javascript needed!