@toheeb/base 1.5.0 → 1.5.1
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/base-settings.js +17 -12
- package/base.html +1 -1
- package/package.json +1 -1
package/base-settings.js
CHANGED
|
@@ -337,20 +337,25 @@ class BaseSettings extends HTMLElement {
|
|
|
337
337
|
|
|
338
338
|
// Color Scheme
|
|
339
339
|
{
|
|
340
|
-
const color_scheme = document.querySelector("meta[name=color-scheme]")
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
340
|
+
const color_scheme = document.querySelector("meta[name=color-scheme]");
|
|
341
|
+
const label_color_scheme = this.querySelector("#base-color-scheme").closest("label");
|
|
342
|
+
|
|
343
|
+
if (color_scheme) {
|
|
344
|
+
const content = color_scheme.content.split(" ");
|
|
345
|
+
const node_color_scheme = this.querySelector("#base-color-scheme");
|
|
346
|
+
const has_light = content.includes("light");
|
|
347
|
+
const has_dark = content.includes("dark");
|
|
348
|
+
|
|
349
|
+
if (has_light && has_dark) {
|
|
350
|
+
node_color_scheme.value = "";
|
|
351
|
+
label_color_scheme.hidden = false;
|
|
352
|
+
} else {
|
|
353
|
+
label_color_scheme.hidden = true;
|
|
354
|
+
}
|
|
351
355
|
} else {
|
|
352
|
-
|
|
356
|
+
label_color_scheme.hidden = true;
|
|
353
357
|
}
|
|
358
|
+
|
|
354
359
|
}
|
|
355
360
|
}
|
|
356
361
|
|
package/base.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Document</title>
|
|
8
8
|
<link rel="stylesheet" href="./base.css">
|
|
9
|
-
<meta name="color-scheme" content="darks
|
|
9
|
+
<meta name="color-scheme" content="darks slight">
|
|
10
10
|
<script src="./base-settings.js"></script>
|
|
11
11
|
</head>
|
|
12
12
|
|