Skip to content

Commit

Permalink
fix dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
floki1250 committed Mar 27, 2024
1 parent b1d0b50 commit f4a1763
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
<script setup>
const colorMode = useColorMode();
function switchColorMode () {
colorMode.value = colorMode.value === "dark" ? "light" : "dark";
colorMode.preference = colorMode.preference === "dark" ? "light" : "dark";
}
</script>
5 changes: 5 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ export default defineNuxtConfig({
css: ["@/assets/main.scss"],
ssr: false,
modules: ["@nuxt/ui", "@nuxtjs/color-mode", "@vueuse/nuxt"],
colorMode: {
preference: "system", // default value of $colorMode.preference
fallback: "light", // fallback value if not system preference found
classSuffix: "",
},
});
2 changes: 1 addition & 1 deletion pages/Receive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<span class="w-8 h-1 rounded-full bg-gray-100 dark:bg-gray-700" />
</template></UBreadcrumb>
<br />
<h1 class="text-3xl text-bold reem-kufi dark:text-white text-black/70">sender</h1>
<h1 class="text-3xl text-bold reem-kufi dark:text-white text-black/70">Receiver</h1>
<p class="reem-kufi text-gray-500">I'm {{ characterName }}</p>
<UDivider class="my-4" />
<UInput color="white" variant="outline" type="text" v-model="sender" placeholder="Sender" />
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Config } from "tailwindcss";

export default <Partial<Config>>{
darkMode: "class",
theme: {
extend: {
colors: {
Expand Down

0 comments on commit f4a1763

Please sign in to comment.