Skip to content

Commit

Permalink
update toggle color
Browse files Browse the repository at this point in the history
  • Loading branch information
maldestor95 committed May 18, 2024
1 parent c0c9e43 commit f62a219
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/toggleswitch.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<!-- code inspired by https://www.w3schools.com/howto/howto_css_switch.asp -->
<div class="flex flex-row debugall items-center">
<div class="flex flex-row items-center">
<div class="mr-2 z-0 pt-1">
<slot>switch label</slot>
</div>
<label class="switch shrink-0 grow-0">
<input type="checkbox" :checked="model" v-model="model" />
<span class="slider" :class="{ round: !props.square }"></span>
<span class="slider" :class="{ round: !props.square, sliderOn: model }"></span>
</label>
<div class="ml-2 z-0 pt-1">
<slot name="post"></slot>
Expand Down Expand Up @@ -50,7 +50,9 @@ const props = withDefaults(defineProps<Props>(), {
-webkit-transition: 0.4s;
transition: 0.4s;
}
.sliderOn {
@apply bg-blue-400;
}
.slider:before {
position: absolute;
content: "";
Expand Down

0 comments on commit f62a219

Please sign in to comment.