Skip to content

Commit

Permalink
fix: make color theme picker not look shit
Browse files Browse the repository at this point in the history
  • Loading branch information
maybeanerd committed Sep 14, 2023
1 parent 43a79f2 commit c3f6c3d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions components/themePicker.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<template>
<NSwitch v-model:value="isDarkTheme">
<template #checked-icon>
🌑
</template>
<template #unchecked-icon>
☀️
<NSwitch v-model:value="isDarkTheme" :rail-style="getRailStyle">
<template #icon>
<NaiveIcon
:name="isDarkTheme ? 'ph:moon' : 'ph:sun'"
:size="14"
icon-color="#111827"
/>
</template>
</NSwitch>
</template>
Expand All @@ -19,4 +20,10 @@ const isDarkTheme = computed({
colorModePreference.set(selectedColorMode);
},
});
function getRailStyle ({ checked }: { checked: boolean }) {
return {
backgroundColor: checked ? '#1f2937' : '#e5e7eb',
};
}
</script>

0 comments on commit c3f6c3d

Please sign in to comment.