>_FoxiRef
>_/cheatsheet/tailwind
TailwindCSS

TailwindCSS 치트시트

자주 사용하는 TailwindCSS 유틸리티 클래스 모음

#반응형 브레이크포인트

클래스CSS설명
sm:@media (min-width: 640px)작은 화면 이상
md:@media (min-width: 768px)중간 화면 이상
lg:@media (min-width: 1024px)큰 화면 이상
xl:@media (min-width: 1280px)특대 화면 이상
2xl:@media (min-width: 1536px)초특대 화면 이상

#상태 (Variants)

클래스CSS설명
hover::hover마우스 오버 시
focus::focus포커스 시
active::active클릭/탭 중
disabled::disabled비활성화 시
first::first-child첫 번째 자식
last::last-child마지막 자식
odd::nth-child(odd)홀수 번째 자식
even::nth-child(even)짝수 번째 자식
group-hover:.group:hover &부모 그룹 호버 시
dark:@media (prefers-color-scheme: dark)다크 모드 시

#간격 (Spacing)

클래스CSS설명
p-{size}padding전체 패딩
px-{size}padding-left/right좌우 패딩
py-{size}padding-top/bottom상하 패딩
pt/pr/pb/pl-{size}padding-top/right/bottom/left개별 방향 패딩
m-{size}margin전체 마진
mx-{size}margin-left/right좌우 마진
my-{size}margin-top/bottom상하 마진
mt/mr/mb/ml-{size}margin-top/right/bottom/left개별 방향 마진
mx-automargin: 0 auto수평 중앙 정렬
gap-{size}gapFlex/Grid 간격
gap-x-{size}column-gap가로 간격
gap-y-{size}row-gap세로 간격
space-x-{size}> * + * { margin-left }자식 요소 가로 간격
space-y-{size}> * + * { margin-top }자식 요소 세로 간격

#크기 (Sizing)

클래스CSS설명
w-{size}width너비
w-fullwidth: 100%전체 너비
w-screenwidth: 100vw화면 너비
w-autowidth: auto자동 너비
w-fitwidth: fit-content콘텐츠에 맞춤
min-w-0min-width: 0최소 너비 0
min-w-fullmin-width: 100%최소 너비 100%
max-w-{size}max-width최대 너비
max-w-screen-{bp}max-width: breakpoint브레이크포인트 최대 너비
h-{size}height높이
h-fullheight: 100%전체 높이
h-screenheight: 100vh화면 높이
min-h-screenmin-height: 100vh최소 화면 높이
max-h-{size}max-height최대 높이
size-{size}width + height너비와 높이 동시 설정

#디스플레이 (Display)

클래스CSS설명
blockdisplay: block블록 요소
inline-blockdisplay: inline-block인라인 블록
inlinedisplay: inline인라인 요소
flexdisplay: flex플렉스 컨테이너
inline-flexdisplay: inline-flex인라인 플렉스
griddisplay: grid그리드 컨테이너
inline-griddisplay: inline-grid인라인 그리드
hiddendisplay: none숨김
contentsdisplay: contents컨테이너 없이 콘텐츠만

#플렉스박스 (Flexbox)

클래스CSS설명
flex-rowflex-direction: row가로 방향
flex-colflex-direction: column세로 방향
flex-row-reverseflex-direction: row-reverse가로 역방향
flex-col-reverseflex-direction: column-reverse세로 역방향
flex-wrapflex-wrap: wrap줄바꿈 허용
flex-nowrapflex-wrap: nowrap줄바꿈 없음
flex-1flex: 1 1 0%남은 공간 채움
flex-autoflex: 1 1 auto자동 크기
flex-noneflex: none고정 크기
growflex-grow: 1늘어남
grow-0flex-grow: 0늘어나지 않음
shrinkflex-shrink: 1줄어듦
shrink-0flex-shrink: 0줄어들지 않음

#정렬 (Alignment)

클래스CSS설명
justify-startjustify-content: flex-start메인 축 시작
justify-centerjustify-content: center메인 축 중앙
justify-endjustify-content: flex-end메인 축 끝
justify-betweenjustify-content: space-between메인 축 양끝 정렬
justify-aroundjustify-content: space-around메인 축 균등 분배
justify-evenlyjustify-content: space-evenly메인 축 동일 간격
items-startalign-items: flex-start교차 축 시작
items-centeralign-items: center교차 축 중앙
items-endalign-items: flex-end교차 축 끝
items-baselinealign-items: baseline교차 축 베이스라인
items-stretchalign-items: stretch교차 축 늘림
self-autoalign-self: auto개별 정렬 자동
self-startalign-self: flex-start개별 정렬 시작
self-centeralign-self: center개별 정렬 중앙
self-endalign-self: flex-end개별 정렬 끝

#그리드 (Grid)

클래스CSS설명
grid-cols-{n}grid-template-columns: repeat(n, 1fr)n개 컬럼
grid-rows-{n}grid-template-rows: repeat(n, 1fr)n개 행
col-span-{n}grid-column: span nn개 컬럼 차지
col-start-{n}grid-column-start: nn번째 컬럼부터
col-end-{n}grid-column-end: nn번째 컬럼까지
row-span-{n}grid-row: span nn개 행 차지
row-start-{n}grid-row-start: nn번째 행부터
row-end-{n}grid-row-end: nn번째 행까지
auto-cols-autogrid-auto-columns: auto자동 컬럼 크기
auto-cols-frgrid-auto-columns: 1fr자동 컬럼 1fr
auto-rows-autogrid-auto-rows: auto자동 행 크기

#위치 (Position)

클래스CSS설명
staticposition: static기본 위치
relativeposition: relative상대 위치
absoluteposition: absolute절대 위치
fixedposition: fixed고정 위치
stickyposition: sticky스티키 위치
top-{size}top상단 거리
right-{size}right우측 거리
bottom-{size}bottom하단 거리
left-{size}left좌측 거리
inset-{size}top/right/bottom/left전체 방향 거리
inset-x-{size}left/right좌우 거리
inset-y-{size}top/bottom상하 거리
z-{n}z-indexZ축 순서
z-autoz-index: autoZ축 자동

#타이포그래피 (Typography)

클래스CSS설명
font-sansfont-family: sans-serif산세리프 폰트
font-seriffont-family: serif세리프 폰트
font-monofont-family: monospace모노스페이스 폰트
text-xsfont-size: 0.75rem아주 작은 글자
text-smfont-size: 0.875rem작은 글자
text-basefont-size: 1rem기본 글자
text-lgfont-size: 1.125rem큰 글자
text-xlfont-size: 1.25rem아주 큰 글자
text-2xl ~ 9xlfont-size: 1.5rem ~ 8rem더 큰 글자들
font-thinfont-weight: 100가장 얇은 굵기
font-lightfont-weight: 300얇은 굵기
font-normalfont-weight: 400보통 굵기
font-mediumfont-weight: 500중간 굵기
font-semiboldfont-weight: 600세미볼드
font-boldfont-weight: 700볼드
italicfont-style: italic이탤릭체
not-italicfont-style: normal이탤릭 해제
leading-{size}line-height줄 높이
tracking-{size}letter-spacing자간

#텍스트 정렬 및 장식

클래스CSS설명
text-lefttext-align: left왼쪽 정렬
text-centertext-align: center중앙 정렬
text-righttext-align: right오른쪽 정렬
text-justifytext-align: justify양쪽 정렬
underlinetext-decoration: underline밑줄
line-throughtext-decoration: line-through취소선
no-underlinetext-decoration: none장식 없음
uppercasetext-transform: uppercase대문자
lowercasetext-transform: lowercase소문자
capitalizetext-transform: capitalize첫글자 대문자
truncateoverflow: hidden; text-overflow: ellipsis말줄임 (한 줄)
line-clamp-{n}-webkit-line-clamp: nn줄 말줄임
whitespace-nowrapwhite-space: nowrap줄바꿈 없음
break-wordsword-wrap: break-word단어 줄바꿈

#색상 (Colors)

클래스CSS설명
text-{color}-{shade}color텍스트 색상
bg-{color}-{shade}background-color배경 색상
bg-gradient-to-{dir}background-image: linear-gradient그라디언트 방향
from-{color}from color그라디언트 시작 색
via-{color}via color그라디언트 중간 색
to-{color}to color그라디언트 끝 색
text-transparentcolor: transparent투명 텍스트
bg-transparentbackground-color: transparent투명 배경
text-currentcolor: currentColor현재 색상 상속

#테두리 (Borders)

클래스CSS설명
borderborder-width: 1px1px 테두리
border-{n}border-width: npxn픽셀 테두리
border-t/r/b/l-{n}border-top/right/bottom/left-width방향별 테두리
border-{color}border-color테두리 색상
border-solidborder-style: solid실선
border-dashedborder-style: dashed점선
border-dottedborder-style: dotted
border-noneborder-style: none테두리 없음
roundedborder-radius: 0.25rem약간 둥글게
rounded-mdborder-radius: 0.375rem중간 둥글게
rounded-lgborder-radius: 0.5rem많이 둥글게
rounded-xlborder-radius: 0.75rem아주 둥글게
rounded-fullborder-radius: 9999px완전 둥글게 (원형)
rounded-noneborder-radius: 0둥글기 없음
rounded-t/r/b/l-{size}border-radius (corners)특정 모서리만

#효과 (Effects)

클래스CSS설명
shadow-smbox-shadow: small작은 그림자
shadowbox-shadow: default기본 그림자
shadow-mdbox-shadow: medium중간 그림자
shadow-lgbox-shadow: large큰 그림자
shadow-xlbox-shadow: extra large아주 큰 그림자
shadow-2xlbox-shadow: 2x large최대 그림자
shadow-innerbox-shadow: inset내부 그림자
shadow-nonebox-shadow: none그림자 없음
opacity-{n}opacity: n%투명도 (0-100)
blurfilter: blur(8px)흐림
blur-{size}filter: blur(size)흐림 정도
brightness-{n}filter: brightness(n%)밝기
contrast-{n}filter: contrast(n%)대비
grayscalefilter: grayscale(100%)흑백
invertfilter: invert(100%)반전

#전환 및 애니메이션

클래스CSS설명
transitiontransition-property: all기본 전환
transition-alltransition-property: all모든 속성 전환
transition-colorstransition-property: colors색상 전환
transition-opacitytransition-property: opacity투명도 전환
transition-transformtransition-property: transform변환 전환
duration-{ms}transition-duration: ms전환 시간
ease-lineartransition-timing: linear선형 이징
ease-intransition-timing: ease-inEase-in
ease-outtransition-timing: ease-outEase-out
ease-in-outtransition-timing: ease-in-outEase-in-out
delay-{ms}transition-delay: ms전환 지연
animate-spinanimation: spin회전 애니메이션
animate-pinganimation: ping핑 애니메이션
animate-pulseanimation: pulse펄스 애니메이션
animate-bounceanimation: bounce바운스 애니메이션

#변환 (Transforms)

클래스CSS설명
scale-{n}transform: scale(n)크기 조절
scale-x-{n}transform: scaleX(n)가로 크기
scale-y-{n}transform: scaleY(n)세로 크기
rotate-{deg}transform: rotate(deg)회전
translate-x-{size}transform: translateX가로 이동
translate-y-{size}transform: translateY세로 이동
skew-x-{deg}transform: skewX(deg)가로 기울임
skew-y-{deg}transform: skewY(deg)세로 기울임
origin-centertransform-origin: center변환 기준점 중앙
origin-toptransform-origin: top변환 기준점 상단
origin-bottomtransform-origin: bottom변환 기준점 하단

#오버플로우 및 기타

클래스CSS설명
overflow-autooverflow: auto필요시 스크롤
overflow-hiddenoverflow: hidden넘침 숨김
overflow-scrolloverflow: scroll항상 스크롤
overflow-visibleoverflow: visible넘침 표시
overflow-x-{value}overflow-x가로 오버플로우
overflow-y-{value}overflow-y세로 오버플로우
cursor-pointercursor: pointer포인터 커서
cursor-not-allowedcursor: not-allowed금지 커서
pointer-events-nonepointer-events: none클릭 불가
select-noneuser-select: none선택 불가
select-textuser-select: text텍스트 선택 가능
select-alluser-select: all클릭시 전체 선택
sr-onlyscreen reader only스크린리더 전용

#색상 팔레트

slate
gray
zinc
red
orange
amber
yellow
lime
green
emerald
teal
cyan
sky
blue
indigo
violet
purple
fuchsia
pink
rose

💡 색상 블록을 클릭하면 클래스명이 복사됩니다 (예: blue-500)

사용법: text-{color}-{shade}, bg-{color}-{shade}, border-{color}-{shade}

#크기 단위 참고

클래스클래스
00pxpx1px
0.50.125rem (2px)10.25rem (4px)
20.5rem (8px)30.75rem (12px)
41rem (16px)51.25rem (20px)
61.5rem (24px)82rem (32px)
102.5rem (40px)123rem (48px)
164rem (64px)205rem (80px)
246rem (96px)328rem (128px)

#자주 묻는 질문 (FAQ)

이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.