Compare commits

..

1 Commits

Author SHA1 Message Date
fda83907f9 add dark-mode in checkbox 2023-03-21 16:07:51 +05:30
2 changed files with 6 additions and 6 deletions

View File

@ -15,12 +15,12 @@
v-if="label" v-if="label"
:for="id" :for="id"
:class="`font-medium ${ :class="`font-medium ${
disabled ? 'text-gray-400 cursor-not-allowed' : 'text-gray-600' disabled ? 'text-gray-400 cursor-not-allowed' : 'text-gray-600 dark:text-white'
} cursor-pointer `" } cursor-pointer `"
> >
{{ label }} {{ label }}
</label> </label>
<p v-if="description" class="text-gray-500">{{ description }}</p> <p v-if="description" class="text-gray-500 dark:text-gray-400">{{ description }}</p>
</div> </div>
</div> </div>
</template> </template>
@ -51,7 +51,7 @@ const props = defineProps({
}, },
checkboxClass: { checkboxClass: {
type: String, type: String,
default: 'w-4 h-4 border-gray-300 rounded cursor-pointer', default: 'w-4 h-4 border-gray-300 rounded cursor-pointer dark:bg-gray-600 dark:border-gray-500',
}, },
setInitialValue: { setInitialValue: {
type: Boolean, type: Boolean,

View File

@ -28,13 +28,13 @@ export default {
}, },
}, },
setup(props, { slots }) { setup(props, { slots }) {
const defaultClass = `cursor-pointer pb-2 pr-0 text-sm font-medium leading-5 flex items-center` const defaultClass = `cursor-pointer pb-2 pr-0 text-sm font-medium leading-5 flex items-center`
let hasIconSlot = computed(() => { let hasIconSlot = computed(() => {
return !!slots.icon return !!slots.icon
}) })
let containerClass = computed(() => { let containerClass = computed(() => {
if (props.active) return `${defaultClass} text-primary-500 dark:text-primary-400` if (props.active) return `${defaultClass} text-primary-500`
else return `${defaultClass} text-gray-500 dark:text-gray-300` else return `${defaultClass} text-gray-500`
}) })
return { return {
hasIconSlot, hasIconSlot,