https://tailwindcss.com/docs/dark-mode#toggling-dark-mode-manually
Dark Mode - Tailwind CSS
Using Tailwind CSS to style your site in dark mode.
tailwindcss.com
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
// Whenever the user explicitly chooses light mode
localStorage.theme = 'light'
// Whenever the user explicitly chooses dark mode
localStorage.theme = 'dark'
// Whenever the user explicitly chooses to respect the OS preference
localStorage.removeItem('theme')
'Laravel' 카테고리의 다른 글
Laravel - .env 환경설정 알아보기 (0) | 2023.10.19 |
---|---|
Laravel - Artisan 명령어 알아보기 (0) | 2023.10.19 |
Laravel - 관리자페이지 filament 설치하기 (0) | 2023.10.18 |
Composer create-project 사용방법 (0) | 2023.10.15 |
Laravel 시작하기 - Bootcamp (0) | 2023.09.23 |