fix(web): settings switch state when disabled, simplify classes (#5762)

This commit is contained in:
Daniel Dietzler 2023-12-17 00:17:38 +01:00 committed by GitHub
parent 19754d4b21
commit bda9fd9dfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,16 +42,15 @@
/> />
{#if disabled} {#if disabled}
<span class="slider-disable cursor-not-allowed" /> <span class="slider slider-disabled cursor-not-allowed" />
{:else} {:else}
<span class="slider cursor-pointer" /> <span class="slider slider-enabled cursor-pointer" />
{/if} {/if}
</label> </label>
</div> </div>
<style> <style>
.slider, .slider {
.slider-disable {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -67,8 +66,7 @@
cursor: not-allowed; cursor: not-allowed;
} }
.slider:before, .slider:before {
.slider-disable:before {
position: absolute; position: absolute;
content: ''; content: '';
height: 20px; height: 20px;
@ -82,18 +80,18 @@
border-radius: 50%; border-radius: 50%;
} }
input:checked + .slider-disable {
background-color: gray;
}
input:checked + .slider {
background-color: #adcbfa;
}
input:checked + .slider:before { input:checked + .slider:before {
-webkit-transform: translateX(18px); -webkit-transform: translateX(18px);
-ms-transform: translateX(18px); -ms-transform: translateX(18px);
transform: translateX(18px); transform: translateX(18px);
background-color: #4250af; background-color: #4250af;
} }
input:checked + .slider-disabled {
background-color: gray;
}
input:checked + .slider-enabled {
background-color: #adcbfa;
}
</style> </style>