Initial commit: OAuth IAM Laravel application
Laravel-based OAuth/IAM service with Passport, Vue 3 frontend, and Docker Compose setup for local and production deployment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
16
resources/js/composables/useTheme.ts
Normal file
16
resources/js/composables/useTheme.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
// El estado inicial ya lo aplicó el script inline en app.blade.php (evita el
|
||||
// flash); acá solo reflejamos esa clase para que el ícono del toggle arranque
|
||||
// sincronizado.
|
||||
const isDark = ref(document.documentElement.classList.contains('dark'));
|
||||
|
||||
function toggleTheme(): void {
|
||||
isDark.value = !isDark.value;
|
||||
document.documentElement.classList.toggle('dark', isDark.value);
|
||||
localStorage.setItem('theme', isDark.value ? 'dark' : 'light');
|
||||
}
|
||||
|
||||
export function useTheme() {
|
||||
return { isDark, toggleTheme };
|
||||
}
|
||||
Reference in New Issue
Block a user