ABitOfJS,
<!DOCTYPE html>
<html>
<head>
<style>
.block {
width: 100px;
height: 100px;
border: 1px solid black;
background-color: white;
color: #292929;
}
.block.dark {
background-color: #292929;
color: white;
}
</style>
<script>
function setTheme(toggle) {
document.querySelectorAll('.block').forEach(elem => elem.classList.toggle('dark', toggle))
localStorage.toggle = toggle;
}
</script>
</head>
<body>
<div class="block">текст</div>
<div class="block">текст</div>
<div class="block">текст</div>
<input type="button" onclick="setTheme(false)" value="light">
<input type="button" onclick="setTheme(true)" value="dark">
<script>
setTheme(localStorage.toggle == 'true')
</script>
</body>
</html>