_includes/head.html in dark-blog-theme-2.1.0 vs _includes/head.html in dark-blog-theme-3.0.0

- old
+ new

@@ -1,27 +1,38 @@ <head> - <meta charset="utf-8" /> - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="preload" href="/assets/theme-assets/theme-fonts/Virgil.woff2" as="font" type="font/woff2" crossorigin - /> + > + {%- seo -%} <link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}"> <script> - const root = document.querySelector("html"); - const theme = window.localStorage.getItem("theme"); + const colors = { + 'dark-pink': '#f0b3e7', + 'dark-green': '#b1d18a', + 'dark-yellow': '#dbc66e', + 'dark-blue': '#aac7ff', + 'dark-cyan': '#81d5cd', + }; + const root = document.querySelector('html'); + const theme = window.localStorage.getItem('theme'); if (theme === null) { - window.localStorage.setItem("theme", "dark-pink"); - root.className = "dark-pink"; + window.localStorage.setItem('theme', 'dark-pink'); + root.className = 'dark-pink'; + root.style.setProperty('--current-color', colors['dark-pink']); } else { root.className = theme; + root.style.setProperty('--current-color', colors[theme]); } </script> <script src="/assets/theme-assets/js/theme.js" defer></script> - {% comment %} {%- feed_meta -%} {% endcomment %} {%- if jekyll.environment == - 'production' and site.google_analytics -%} {%- include google-analytics.html - -%} {%- endif -%} + {%- feed_meta -%} + {%- if jekyll.environment == 'production' and site.google_analytics -%} + {%- include google-analytics.html -%} + {%- endif -%} </head>