mirror of https://github.com/sveltejs/svelte
parent
a4f360dd83
commit
8a85955fae
@ -0,0 +1,35 @@
|
||||
<script>
|
||||
export let checked;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.input-output-toggle {
|
||||
display: grid;
|
||||
position: absolute;
|
||||
user-select: none;
|
||||
grid-template-columns: 1fr 40px 1fr;
|
||||
grid-gap: 0.5em;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 42px;
|
||||
border-top: 1px solid var(--second);
|
||||
}
|
||||
|
||||
input {
|
||||
display: block;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #555;
|
||||
}
|
||||
</style>
|
||||
|
||||
<label class="input-output-toggle">
|
||||
<span class:active={!checked} style="text-align: right">input</span>
|
||||
<input type="checkbox" bind:checked>
|
||||
<span class:active={checked}>output</span>
|
||||
</label>
|
Loading…
Reference in new issue