Skip to content

Commit f554d90

Browse files
committed
Dynamic size adjustments on theme changes.
1 parent 83fd467 commit f554d90

File tree

1 file changed

+42
-36
lines changed

1 file changed

+42
-36
lines changed

src/ui/ui.css

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@
3131
}
3232

3333
#presets .presets input.preset {
34-
min-width: 5em;
34+
min-width: 7em;
3535
}
3636

3737
#sites .presets input.preset {
3838
min-width: 0 !important;
3939
margin-top: 0;
40+
margin-left: 0;
41+
margin-right: 1em;
4042
font-weight: bold;
4143
}
4244

@@ -52,31 +54,33 @@
5254
}
5355

5456
#presets .presets input.preset + label {
55-
font-size: 60%;
56-
position: absolute !important;
57-
text-align: right;
58-
padding: 0 !important;
59-
margin: 0 !important;
60-
display: block !important;
61-
width: 5.5em !important;
62-
z-index: 1000;
63-
top: 1em;
64-
left: 4em !important;
65-
text-shadow: 1px 1px var(--bg-color2), -1px -1px var(--bg-color2);
66-
}
57+
font-size: 75%;
58+
position: absolute !important;
59+
text-align: left;
60+
padding: 0px !important;
61+
margin: 0px !important;
62+
display: block !important;
63+
width: 5.8em !important;
64+
overflow: visible;
65+
z-index: 1000;
66+
bottom: 0px;
67+
left: 4.2em;
68+
text-shadow: 1px 1px var(--bg-color2), -1px -1px var(--bg-color2);
69+
}
6770

6871
#sites .presets input.preset:checked + label {
69-
z-index: 1000;
70-
font-size: 60%;
71-
top: 3em;
72-
left: -3em !important;
73-
margin: 0 !important;
74-
padding: 0 !important;
75-
text-align: center !important;
76-
display: block !important;
77-
position: absolute;
78-
width: 10em !important;
79-
overflow: visible !important;
72+
z-index: 1000;
73+
font-size: 60%;
74+
width: calc(var(--line-size) * 3);
75+
left: -33%;
76+
top: calc(var(--line-size) * 1.5);
77+
margin: 0 !important;
78+
padding: 0 !important;
79+
text-align: center !important;
80+
display: block !important;
81+
position: absolute;
82+
overflow: visible !important;
83+
background-image: none !important;
8084
}
8185

8286
.presets input.preset:checked ~ input.temp {
@@ -87,23 +91,21 @@
8791
.customizing input.preset:checked ~ input.temp {
8892
pointer-events: all !important;
8993
z-index: 1000;
90-
top: 1.75em;
91-
left: auto;
92-
right: -2.2em;
93-
padding: 1em;
94+
left: var(--line-size);
95+
padding: calc(var(--line-size) / 2);
9496
}
9597

9698
#sites .customizing input.preset:checked + label {
9799
text-align:right !important;
98100
right: 0em !important;
99-
left: auto !important;
101+
100102
pointer-events: none;
101103
transition: all .2s;
102104
}
103105

104106
td.presets {
105107
white-space: nowrap !important;
106-
vertical-align: bottom;
108+
vertical-align: middle;
107109
border: 1px solid var(--fg-color2);
108110
}
109111
.url > span > span {
@@ -126,6 +128,7 @@
126128
#sites .customizing .presets {
127129
padding-bottom: 0 !important;
128130
margin-bottom: 0 !important;
131+
vertical-align: bottom;
129132
}
130133

131134
.capsContext, .capsContext > div {
@@ -277,8 +280,9 @@ td.presets {
277280
span.preset {
278281
position: relative;
279282
display: inline-block;
280-
top: 0.13em;
281283
font-size: 1em;
284+
height: var(--line-size);
285+
top: 2px;
282286
}
283287

284288
.preset label, .preset input, .preset button {
@@ -294,7 +298,7 @@ span.preset {
294298
outline: 0;
295299
opacity: .6;
296300
margin: 0 .5em 0.13em .5em;
297-
background-size: calc(var(--line-size) - .2em);
301+
background-size: var(--line-size);
298302
width: var(--line-size);
299303
height: var(--line-size);
300304
}
@@ -317,7 +321,7 @@ span.preset {
317321
opacity: 1;
318322
transform: none;
319323
min-width: 9.38em;
320-
background-position-x: 0;
324+
background-position-x: calc(var(--line-size) / 10);
321325
}
322326

323327
.presets input.preset:focus {
@@ -331,14 +335,14 @@ span.preset {
331335
.presets label.preset {
332336
padding: 0;
333337
letter-spacing: -0.06em;
334-
width: 0em;
338+
width: 0;
335339
overflow: hidden;
336340
display: none;
337341
text-transform: uppercase;
338342
color: var(--fg-color2);
339343
opacity: .7;
340344
position: absolute;
341-
left: 0em;
345+
left: 0;
342346
padding-left: 3em;
343347
line-height: var(--line-size);
344348
}
@@ -349,9 +353,10 @@ span.preset {
349353

350354
.presets input.preset:checked + label, #presets .presets label {
351355
opacity: 1;
352-
width: 80%;
353356
display: inline-flex;
357+
width: 75%;
354358
}
359+
355360
:not(#presets) > .sites .site:not(.customizing) .presets input.preset:checked + label.preset {
356361
background-image: linear-gradient(to right, transparent calc(var(--line-size) * 1.5), var(--bg-color1) 50%);
357362
border-radius: calc(var(--line-size) / 2);
@@ -426,6 +431,7 @@ input.preset:checked ~ input.temp {
426431

427432
.customizing input.preset:checked, #presets input.preset:checked {
428433
background-color: var(--form-color2);
434+
height: calc(var(--line-size) + 0.2em);
429435
}
430436

431437
.customizer fieldset {

0 commit comments

Comments
 (0)