이 포스트는 NextJs 15 에서 사용하는 tailwind 3.4.1 기준으로 작성되었습니다.
25.4.9 추가: tailwind 4.x 버전에서도 마이그레이션 후 동일하게 적용됩니다. @theme 속성도 존재하지만 저는 snippit을 지원하는 이 방식을 더욱 선호합니다.
@tailwind base;
@tailwind components;
@tailwind utilities;module.exports = {
	theme: {
		screens: {
			sm: '640px',
			md: '768px',
			lg: '1024px',
			xl: '1280px',
		}
	}
}...
<div class="bg-blue-500 sm:bg-red-500 md:bg-green-500 lg:bg-yellow-500 xl:bg-purple-500">
	Responsive Design
</div>
...module.exports = {
	theme: {
		colors: {
			custom-blue: '#0000ff',
			custom-red: '#ff0000',
			gray: {
				100: '#f7fafc',
			},
		}
	}
}...
<div class="bg-custom-blue">
	Custom Blue
</div>
<div class="bg-custom-red">
	Custom Red
</div>
<div class="bg-gray-100">
	Custom Gray 100
</div>
...module.exports = {
	theme: {
		extend: {
			fontFamily: {
				custom: ['Noto Sans KR', 'sans-serif'],
			},
			fontSize: {
				'7xl': '5rem',
			},
			spacing: {
				'72': '18rem',
			},
			borderRadius: {
				DEFAULT: '0.25rem',
				xl: '1rem',
			},
		}
	}
}...
<div class="font-custom text-7xl">
	Custom Font Size
</div>
<div class="p-72">
	Custom Spacing
</div>
<div class="rounded">
	Custom Default Border Radius
</div>
<div class="rounded-xl">
	Custom XL Border Radius
</div>
...module.exports = {
	theme: {
		container: {
			center: true,
			padding: '2rem',
		}
	}
}...
<div class="container mx-auto">
	Container
</div>
...module.exports = {
	theme: {
		spacing: {
      px: '1px',
      0: '0',
      0.5: '0.125rem',
      1: '0.25rem',
      1.5: '0.375rem',
      2: '0.5rem',
      2.5: '0.625rem',
      3: '0.75rem',
      3.5: '0.875rem'
		}
	}
}...
<div class="p-px">
	1px
</div>
<div class="p-0">
	0
</div>
<div class="p-0.5">
	0.5
</div>
...import plugin from "tailwindcss/plugin";
 
module.exports = {
	plugins: [
		function ({ addComponents }) {
			addComponents({
				'.btn': {
					padding: '.5rem 1rem',
					borderRadius: '.25rem',
					fontWeight: '600',
				}
			})
		}
	]
}...
<div class="btn bg-blue-500 text-white">
	Button
</div>
...import plugin from "tailwindcss/plugin";
 
module.exports = {
	plugins: [
		function ({ addComponents }) {
			addComponents({
        ".headline-0": {
          fontFamily: '"Pretendard"',
          fontSize: "48px",
          fontWeight: "500",
          lineHeight: "normal",
          letterSpacing: "-0.48px",
        },
			})
		}
	]
}...
<div class="headline-0">
	Headline 0
</div>
...tailwind 기본 설정 파일에서 시작
@tailwind base;
@tailwind components;
@tailwind utilities;.btn {
	padding: .5rem 1rem;
	border-radius: .25rem;
	font-weight: 600;
}...
<div class="btn bg-blue-500 text-white">
	Button
</div>
...@layer base {
  :root {
    --background: #f8f8f8;
    --foreground: #171717;
  }
}module.exports = {
	darkMode: 'class',
	theme: {
		extend: {
			colors: {
				background: 'var(--background)',
				foreground: 'var(--foreground)',
			}
		}
	}
}...
<div class="bg-background text-foreground">
	Background & Foreground
</div>
...public/
	fonts/
		Pretendard-Thin.ttf
		Pretendard-ExtraLight.ttf
		Pretendard-Light.ttf
		Pretendard-Regular.ttf
		Pretendard-Medium.ttf
		Pretendard-SemiBold.ttf
		Pretendard-Bold.ttf
		Pretendard-ExtraBold.ttf
		Pretendard-Black.ttf@font-face {
  font-family: "Pretendard";
  src: url("/fonts/Pretendard-Thin.ttf") format("truetype");
  font-weight: 100;
}
@font-face {
  font-family: "Pretendard";
  src: url("/fonts/Pretendard-ExtraLight.ttf") format("truetype");
  font-weight: 200;
}
@font-face {
  font-family: "Pretendard";
  src: url("/fonts/Pretendard-Light.ttf") format("truetype");
  font-weight: 300;
}
@font-face {
  font-family: "Pretendard";
  src: url("/fonts/Pretendard-Regular.ttf") format("truetype");
  font-weight: 400;
}
@font-face {
  font-family: "Pretendard";
  src: url("/fonts/Pretendard-Medium.ttf") format("truetype");
  font-weight: 500;
}
@font-face {
  font-family: "Pretendard";
  src: url("/fonts/Pretendard-SemiBold.ttf") format("truetype");
  font-weight: 600;
}
@font-face {
  font-family: "Pretendard";
  src: url("/fonts/Pretendard-Bold.ttf") format("truetype");
  font-weight: 700;
}
@font-face {
  font-family: "Pretendard";
  src: url("/fonts/Pretendard-ExtraBold.ttf") format("truetype");
  font-weight: 800;
}
@font-face {
  font-family: "Pretendard";
  src: url("/fonts/Pretendard-Black.ttf") format("truetype");
  font-weight: 900;
}module.exports = {
	theme: {
		extend: {
			fontFamily: {
				pretendard: ["Pretendard"],
			}
		}
	}
}import '../util/font.css';
......
<div class="font-pretendard text-7xl">
	Pretendard Font
</div>
...@layer base {
	:root {
    --background: 255, 255, 255;
    --foreground: 240, 240, 240;
	}
}module.exports = {
	theme: {
		extend: {
			colors: {
        background: "rgba(var(--background) , <alpha-value>)",
        foreground: "rgba(var(--foreground) , <alpha-value>)",
			}
		}
	}
}@layer base {
	:root {
		--background: 0, 0%, 100%;
		--foreground: 0, 0%, 94%;
	}
}module.exports = {
	theme: {
		extend: {
			colors: {
				background: "hsla(var(--background) , <alpha-value>)",
				foreground: "hsla(var(--foreground) , <alpha-value>)",
			}
		}
	}
}