@toheeb/base 1.5.0 → 1.5.5
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 +23 -12
- package/base.css +13 -4
- package/base.html +1 -1
- package/package.json +1 -1
package/base-settings.js
CHANGED
|
@@ -119,6 +119,8 @@ class BaseSettings extends HTMLElement {
|
|
|
119
119
|
|
|
120
120
|
._bs button[type=submit] {
|
|
121
121
|
display: flex;
|
|
122
|
+
justify-content: center;
|
|
123
|
+
align-items: center;
|
|
122
124
|
border: 0;
|
|
123
125
|
margin: auto;
|
|
124
126
|
padding: .25em;
|
|
@@ -137,6 +139,10 @@ class BaseSettings extends HTMLElement {
|
|
|
137
139
|
justify-content: space-between;
|
|
138
140
|
gap: calc(.25 * var(--bbg)) calc(.75 * var(--bbg));
|
|
139
141
|
}
|
|
142
|
+
|
|
143
|
+
._bs .modes {
|
|
144
|
+
margin-top: var(--bbg);
|
|
145
|
+
}
|
|
140
146
|
|
|
141
147
|
._bs .fields label:not([hidden]) {
|
|
142
148
|
display: grid;
|
|
@@ -337,20 +343,25 @@ class BaseSettings extends HTMLElement {
|
|
|
337
343
|
|
|
338
344
|
// Color Scheme
|
|
339
345
|
{
|
|
340
|
-
const color_scheme = document.querySelector("meta[name=color-scheme]")
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
346
|
+
const color_scheme = document.querySelector("meta[name=color-scheme]");
|
|
347
|
+
const label_color_scheme = this.querySelector("#base-color-scheme").closest("label");
|
|
348
|
+
|
|
349
|
+
if (color_scheme) {
|
|
350
|
+
const content = color_scheme.content.split(" ");
|
|
351
|
+
const node_color_scheme = this.querySelector("#base-color-scheme");
|
|
352
|
+
const has_light = content.includes("light");
|
|
353
|
+
const has_dark = content.includes("dark");
|
|
354
|
+
|
|
355
|
+
if (has_light && has_dark) {
|
|
356
|
+
node_color_scheme.value = "";
|
|
357
|
+
label_color_scheme.hidden = false;
|
|
358
|
+
} else {
|
|
359
|
+
label_color_scheme.hidden = true;
|
|
360
|
+
}
|
|
351
361
|
} else {
|
|
352
|
-
|
|
362
|
+
label_color_scheme.hidden = true;
|
|
353
363
|
}
|
|
364
|
+
|
|
354
365
|
}
|
|
355
366
|
}
|
|
356
367
|
|
package/base.css
CHANGED
|
@@ -122,8 +122,9 @@ small, ::marker
|
|
|
122
122
|
select::picker-icon {
|
|
123
123
|
--bfs: var(--bfs-075);
|
|
124
124
|
font-size: calc(var(--bfs) * 1rem);
|
|
125
|
-
line-height: 2.2em;
|
|
126
|
-
|
|
125
|
+
/* line-height: 2.2em; */
|
|
126
|
+
/* line-height: inherit */
|
|
127
|
+
/* transform-origin: 50%; */
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
/* 5 */
|
|
@@ -761,16 +762,24 @@ select,
|
|
|
761
762
|
appearance: base-select;
|
|
762
763
|
}
|
|
763
764
|
|
|
765
|
+
|
|
764
766
|
select {
|
|
765
767
|
font: inherit;
|
|
766
|
-
height: 2em;
|
|
767
|
-
padding: 0 .5em .2em .3em;
|
|
768
768
|
width: fit-content;
|
|
769
769
|
gap: 2em;
|
|
770
|
+
padding: 0 .3em .15em .3em;
|
|
771
|
+
align-items: center;
|
|
772
|
+
|
|
773
|
+
/* Use lineheight over height to align ::picker to center. Sum to 2em considering padding bottom and border top & bottom */
|
|
774
|
+
line-height: 1.725em;
|
|
770
775
|
}
|
|
771
776
|
|
|
772
777
|
select::picker-icon {
|
|
773
778
|
transition: .4s rotate;
|
|
779
|
+
|
|
780
|
+
/* avoid cutoff upon clicked */
|
|
781
|
+
transform-origin: 40% 50%;
|
|
782
|
+
transform: translateX(-1px);
|
|
774
783
|
}
|
|
775
784
|
|
|
776
785
|
select:open::picker-icon {
|
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
|
|