Skip to content

Commit 4f481bb

Browse files
committed
more tweaks
1 parent 8970592 commit 4f481bb

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

packages/repl/src/lib/Output/CompilerOptions.svelte

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<!-- svelte-ignore a11y_label_has_associated_control (TODO this warning should probably be disabled if there's a component)-->
2828
<label class="option">
2929
<span class="key">dev:</span>
30-
<span style="font-size: 1.2rem">
30+
<span style="position: relative; font-size: 1.2rem; top: 0.2em">
3131
<Checkbox
3232
checked={workspace.compiler_options.dev!}
3333
onchange={(dev) => {
@@ -70,10 +70,6 @@
7070
color: var(--shiki-token-string);
7171
}
7272
73-
label :global(input[type='checkbox']) {
74-
top: -1px;
75-
}
76-
7773
input[type='radio'] {
7874
position: absolute;
7975
top: auto;

packages/site-kit/src/lib/components/Checkbox.svelte

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
<style>
1111
input[type='checkbox'] {
12+
--thumb-size: 1em;
13+
--track-padding: 2px;
1214
/* display: block; */
1315
position: relative;
14-
height: 1em;
15-
width: 2em;
16-
top: -2px;
16+
height: calc(var(--thumb-size) + 2 * var(--track-padding));
17+
width: calc(2 * var(--thumb-size) + 2 * var(--track-padding));
1718
border-radius: 0.5em;
1819
-webkit-appearance: none;
1920
appearance: none;
20-
outline: none;
2121
border: transparent;
2222
margin: 0 0.6em 0 0;
2323
}
@@ -28,12 +28,11 @@
2828
display: block;
2929
height: 100%;
3030
width: 100%;
31-
padding: 2px;
32-
border-radius: 1em;
3331
top: 0;
3432
left: 0;
33+
border-radius: 9999px;
3534
background: var(--sk-bg-4);
36-
box-sizing: content-box;
35+
box-sizing: border-box;
3736
}
3837
3938
input[type='checkbox']:checked::before {
@@ -44,10 +43,10 @@
4443
content: '';
4544
position: absolute;
4645
display: block;
47-
height: 1em;
48-
width: 1em;
49-
top: 2px;
50-
left: 2px;
46+
height: var(--thumb-size);
47+
aspect-ratio: 1;
48+
top: var(--track-padding);
49+
left: var(--track-padding);
5150
border-radius: 1em;
5251
background: var(--sk-bg-1);
5352
box-shadow:
@@ -59,6 +58,6 @@
5958
}
6059
6160
input[type='checkbox']:checked::after {
62-
left: calc(100% - 1em + 2px);
61+
left: calc(100% - var(--thumb-size) - var(--track-padding));
6362
}
6463
</style>

0 commit comments

Comments
 (0)