@kupola/kupola 1.9.2 → 1.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kupola/kupola",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "A lightweight UI toolkit for any web project. No heavy frontend frameworks required.",
5
5
  "main": "dist/kupola.cjs.js",
6
6
  "module": "dist/kupola.esm.js",
@@ -27,7 +27,7 @@ class KupolaWebpackPlugin {
27
27
 
28
28
  // Inject theme preload script
29
29
  if (this.options.themePreload && !html.includes('data-kupola-theme-preloaded')) {
30
- const preloadScript = '<script>(function(){if(document.documentElement.hasAttribute(\'data-kupola-theme-preloaded\'))return;var k=\'kupola-theme\',d=\'dark\';function g(){var s=localStorage.getItem(k);if(s===\'dark\'||s===\'light\')return s;if(window.matchMedia&&window.matchMedia(\'(prefers-color-scheme: light)\').matches)return\'light\';return d}var theme=g();document.documentElement.setAttribute(\'data-theme\',theme);var root=document.documentElement;root.style.setProperty(\'--bg-base-default\',theme===\'dark\'?\'#0C0C0D\':\'#FFFFFF\');root.style.setProperty(\'--text-default\',theme===\'dark\'?\'#E5E7EB\':\'#0F1117\');document.documentElement.setAttribute(\'data-kupola-theme-preloaded\',\'true\')})();</script>';
30
+ const preloadScript = '<script>(function(){if(document.documentElement.hasAttribute("data-kupola-theme-preloaded"))return;var h=document.documentElement,t=localStorage.getItem("kupola-theme")||(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark");h.setAttribute("data-theme",t);var d=t==="dark";h.style.backgroundColor=d?"#0C0C0D":"#FFFFFF";h.style.color=d?"#E5E7EB":"#0F1117";var s=document.createElement("style");s.textContent=d?"body,header,aside,footer{background:#1A1B1D;color:#E5E7EB}":"body,header,aside,footer{background:#F5F5F5;color:#0F1117}";document.head.appendChild(s);h.setAttribute("data-kupola-theme-preloaded","true")})();</script>';
31
31
 
32
32
  html = html.replace(
33
33
  '<head>',