@toheeb/base 1.5.1 → 1.5.6
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 +19 -5
- 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;
|
|
@@ -202,17 +208,25 @@ class BaseSettings extends HTMLElement {
|
|
|
202
208
|
|
|
203
209
|
// Indent Mode
|
|
204
210
|
{
|
|
205
|
-
const mode_indent = root_styles.getPropertyValue("--base-mode-indent").trim();
|
|
206
211
|
const label_mode_indent = this.querySelector("#base-mode-indent").closest("label");
|
|
212
|
+
const has_other_sheet = doc_sheets.some(sheet => sheet.title?.toLowerCase()?.trim() != "base");
|
|
213
|
+
const mode_indent = root_styles.getPropertyValue("--base-mode-indent").trim();
|
|
207
214
|
|
|
208
|
-
if (
|
|
209
|
-
label_mode_indent.hidden = false;
|
|
210
|
-
this.querySelector("#base-mode-indent").checked = parseInt(mode_indent) === 1;
|
|
211
|
-
} else {
|
|
215
|
+
if (has_other_sheet) {
|
|
212
216
|
label_mode_indent.hidden = true;
|
|
217
|
+
mode_indent.checked = false;
|
|
218
|
+
} else {
|
|
219
|
+
|
|
220
|
+
if (mode_indent) {
|
|
221
|
+
label_mode_indent.hidden = false;
|
|
222
|
+
this.querySelector("#base-mode-indent").checked = parseInt(mode_indent) === 1;
|
|
223
|
+
} else {
|
|
224
|
+
label_mode_indent.hidden = true;
|
|
225
|
+
}
|
|
213
226
|
}
|
|
214
227
|
}
|
|
215
228
|
|
|
229
|
+
|
|
216
230
|
// Font Family
|
|
217
231
|
{
|
|
218
232
|
const font_family = root_styles.getPropertyValue("--base-font-family").trim();
|
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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta charset="UTF-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Document</title>
|
|
8
|
-
<link rel="stylesheet" href="./base.css">
|
|
8
|
+
<link rel="stylesheet" href="./base.css" title="Base">
|
|
9
9
|
<meta name="color-scheme" content="darks slight">
|
|
10
10
|
<script src="./base-settings.js"></script>
|
|
11
11
|
</head>
|