<!DOCTYPE html>
<html lang="en">
  <head>
    <script>
      function getTheme() {
        if (localStorage.getItem("userTheme") != null) {
          return localStorage.getItem("userTheme");
        }
        if (window.matchMedia) {
          if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
            return 'dark';
          } else if (window.matchMedia('(prefers-color-scheme: light)').matches) {
            return 'light';
          }
        }
        // fallback
        return 'light'