티스토리 뷰
반응형
[nextjs+ts]프로젝트 02. TailwindCSS 설정
[설치]
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
npm install -D prettier prettier-plugin-tailwindcss
[경로 설정] - tailwind.config.js
module.exports = {
content: ["./pages/**/*.{js,jsx,ts,tsx}","./components/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
}
[글로벌 지정] - index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
[테스트 코드] - index.tsx
import type { NextPage } from 'next'
import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
const Home: NextPage = () => {
return (
<div className='bg-red-500' >
<h1 className='text-blue-100' >it works</h1>
</div>
)
}
export default Home
vscode에서 tailwindcss intelisense 설치
#nextjs #ts #TailwindCSS
반응형
'nextjs+typescript 기반 CMS 개발 프로젝트' 카테고리의 다른 글
[nextjs+ts]( 번외) join과 tailwind를 활용하여 동적 css 구현 (0) | 2022.03.08 |
---|---|
[nextjs+ts]( 번외) TailwindCSS 지원 Class를 제외한 값 커스텀하기 (0) | 2022.03.08 |
[nextjs+ts]프로젝트 04.로그인 페이지 Modifiers(peer/hover)를 이용한 예외처리/이벤트 처리 (0) | 2022.03.08 |
[nextjs+ts]프로젝트 03. TailwindCSS로 기본 로그인 페이지 만들기 (0) | 2022.03.08 |
[nextjs+ts]프로젝트 01. 개발환경 설정 (0) | 2022.03.07 |
댓글
반응형