Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 54 additions & 34 deletions assets/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,68 +5,88 @@
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--foreground: 0 0% 3.9%;

--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--muted: 0 0% 96.1%;
--muted-foreground: 0 0% 45.1%;

--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--popover-foreground: 0 0% 3.9%;

--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--card-foreground: 0 0% 3.9%;

--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--border: 0 0% 89.8%;
--input: 0 0% 89.8%;

--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;
--primary: 0 0% 9%;
--primary-foreground: 0 0% 98%;

--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--secondary: 0 0% 96.1%;
--secondary-foreground: 0 0% 9%;

--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--accent: 0 0% 96.1%;
--accent-foreground: 0 0% 9%;

--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 40% 98%;
--destructive-foreground: 0 0% 98%;

--ring: 222.2 84% 4.9%;
--ring: 0 0% 3.9%;

--radius: 0.5rem;

--chart-1: 12 76% 61%;

--chart-2: 173 58% 39%;

--chart-3: 197 37% 24%;

--chart-4: 43 74% 66%;

--chart-5: 27 87% 67%;
}

.dark {
--background: 224 71% 4%;
--foreground: 213 31% 91%;
--background: 0 0% 3.9%;
--foreground: 0 0% 98%;

--muted: 223 47% 11%;
--muted-foreground: 215.4 16.3% 70%;
--muted: 0 0% 14.9%;
--muted-foreground: 0 0% 63.9%;

--popover: 224 71% 4%;
--popover-foreground: 215 20.2% 91%;
--popover: 0 0% 3.9%;
--popover-foreground: 0 0% 98%;

--card: 224 71% 4%;
--card-foreground: 213 31% 91%;
--card: 0 0% 3.9%;
--card-foreground: 0 0% 98%;

--border: 216 34% 17%;
--input: 216 34% 17%;
--border: 0 0% 14.9%;
--input: 0 0% 14.9%;

--primary: 210 40% 98%;
--primary-foreground: 222.2 47.4% 1.2%;
--primary: 0 0% 98%;
--primary-foreground: 0 0% 9%;

--secondary: 222 47% 11%;
--secondary-foreground: 210 40% 98%;
--secondary: 0 0% 14.9%;
--secondary-foreground: 0 0% 98%;

--accent: 216 34% 17%;
--accent-foreground: 210 40% 98%;
--accent: 0 0% 14.9%;
--accent-foreground: 0 0% 98%;

--destructive: 0 63% 31%;
--destructive-foreground: 210 40% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;

--ring: 216 34% 17%;
--ring: 0 0% 83.1%;

--radius: 0.5rem;

--chart-1: 220 70% 50%;

--chart-2: 160 60% 45%;

--chart-3: 30 80% 55%;

--chart-4: 280 65% 60%;

--chart-5: 340 75% 55%;
}
}

Expand Down
12 changes: 7 additions & 5 deletions components.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
"$schema": "https://shadcn-vue.com/schema.json",
"style": "new-york",
"typescript": true,
"tsConfigPath": ".nuxt/tsconfig.json",
"tailwind": {
"config": "tailwind.config.ts",
"css": "assets/css/tailwind.css",
"baseColor": "slate",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"framework": "nuxt",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
"composables": "@/composables",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib"
},
"iconLibrary": "lucide"
}
77 changes: 63 additions & 14 deletions components/ThemeToggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,85 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
import { Button } from '#components'

const colorMode = useColorMode()

// Función para cambiar el tema de manera inmediata
const changeTheme = (theme: 'light' | 'dark' | 'system') => {
colorMode.preference = theme
// Si es system, usar la preferencia del sistema
if (theme === 'system') {
colorMode.value = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
} else {
colorMode.value = theme
}

nextTick(() => {
document.documentElement.setAttribute('data-theme', colorMode.value)
})
}
</script>

<template>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon">
<Icon
name="ph:sun-bold"
class="h-5 w-5 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"
/>
<Icon
name="ph:moon-bold"
class="absolute h-5 w-5 rotate-90 scale-0 transition-transform dark:rotate-0 dark:scale-100"
/>
<transition name="theme-icon" mode="out-in">
<Icon
v-if="colorMode.value === 'light'"
key="light"
name="ph:sun-bold"
class="h-5 w-5"
/>
<Icon
v-else
key="dark"
name="ph:moon-bold"
class="h-5 w-5"
/>
</transition>
<span class="sr-only">Toggle theme</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem @click="colorMode.preference = 'light'">
<DropdownMenuItem @click="changeTheme('light')">
<Icon name="ph:sun-bold" class="mr-2 h-4 w-4" />
Light
<span>Light</span>
<Icon
v-if="colorMode.value === 'light'"
name="ph:check-bold"
class="ml-auto h-4 w-4"
/>
</DropdownMenuItem>
<DropdownMenuItem @click="colorMode.preference = 'dark'">
<DropdownMenuItem @click="changeTheme('dark')">
<Icon name="ph:moon-bold" class="mr-2 h-4 w-4" />
Dark
<span>Dark</span>
<Icon
v-if="colorMode.value === 'dark'"
name="ph:check-bold"
class="ml-auto h-4 w-4"
/>
</DropdownMenuItem>
<DropdownMenuItem @click="colorMode.preference = 'system'">
<DropdownMenuItem @click="changeTheme('system')">
<Icon name="ph:desktop-bold" class="mr-2 h-4 w-4" />
System
<span>System</span>
<Icon
v-if="colorMode.preference === 'system'"
name="ph:check-bold"
class="ml-auto h-4 w-4"
/>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</template>

<style scoped>
.theme-icon-enter-active,
.theme-icon-leave-active {
transition: transform 0.2s ease, opacity 0.2s ease;
}

.theme-icon-enter-from,
.theme-icon-leave-to {
opacity: 0;
transform: scale(0.95);
}
</style>
14 changes: 14 additions & 0 deletions components/icons/IconSearch.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="8.5" cy="8.5" r="5.5" />
<path d="M17.5 17.5L12 12" />
</svg>
</template>
Loading