블로그 (1) 1분만에 Nextjs에서 다크모드 구현하기 (next-themes + tailwindCSS) Nextjs에서 다크모드 구현하기본 블로그는 next-themes(next-themes) + tailwindCSS를 사용하여 다크모드가 구현되어 있고, 그 방법이 매우 간편하여 소개하고자 한다.next-themesnext-thems설치$ npm install next-themes or$ yarn add next-themesnext-themes 사용Nextjs의 layout 파일에서 'use client'를 사용하고 있을 경우, 공식문서 그대로 컴포넌트를 ThemeProvider로 감싸주면 된다.// layout.tsximport { ThemeProvider } from 'next-themes'function MyApp({ Component, pageProps }) { return ( .. 이전 1 다음