CSS 속성, Tailwind 유틸리티 표

강연주·2025년 11월 8일

📚 TIL

목록 보기
180/186

외워 쓸 내용이 아니라는 사실, 알고 있지만 그냥 암기됐으면 좋겠다. 하나하나 더듬더듬 타이핑/수정하는 내가 답답스러워욥

차라리 영어 단어 100개를 외우라면 외우겠..

🪸 font-weight로 보는 CSS 속성, Tailwind 유틸리티 혼동 포인트

🖥️ globals.css
@theme {
  --color-mint-500: #d1ffff;
  --color-myColor: #c71eff;
  --font-weight-chubby: bold; // 숫자로 넣는 게 더 안전하대. 처비 귀엽지..?
  ➡️ --font-weight-chubby: 600;
}

.my-dark-element {
  background: black;
  color: white;
  font: semi-bold; ❌ // 내가 만든 끔찍한 혼종
  ➡️ font-weight: 400; ✅
  @variant dark {
    @variant hover {
      background: red;
      color: purple;
      font: extra-bold; ❌ // 내가 만든 끔찍한 혼종
      ➡️ font-weight: 800; ✅
    }
  }
}

✅ 올바른 문법

font-weight: 600;      /* 숫자 값 */
font-weight: bold;     /* 키워드 */
font-weight: var(--font-weight-chubby); /* theme 변수 */

CSS 속성, Tailwind 유틸리티 표

🔹 레이아웃 (Layout)

CSS 속성Tailwind 유틸리티예시
displayblock, inline-block, flex, grid, hiddendisplay: flex → flex
positionstatic, relative, absolute, fixed, stickyposition: relative → relative
top, right, bottom, lefttop-0, right-4, bottom-auto, left-1/2top: 0 → top-0
z-indexz-0, z-10, z-50z-index: 10 → z-10
overflowoverflow-hidden, overflow-auto, overflow-scrolloverflow: hidden → overflow-hidden
overflow-x, overflow-yoverflow-x-auto, overflow-y-scrolloverflow-x: auto → overflow-x-auto

🔹 Flexbox

CSS 속성Tailwind 유틸리티예시
flex-directionflex-row, flex-col, flex-row-reverseflex-direction: column → flex-col
flex-wrapflex-wrap, flex-nowrap, flex-wrap-reverseflex-wrap: wrap → flex-wrap
justify-contentjustify-start, justify-center, justify-between, justify-aroundjustify-content: center → justify-center
align-itemsitems-start, items-center, items-end, items-stretchalign-items: center → items-center
align-contentcontent-start, content-center, content-betweenalign-content: center → content-center
align-selfself-auto, self-start, self-center, self-endalign-self: center → self-center
flex-growgrow, grow-0flex-grow: 1 → grow
flex-shrinkshrink, shrink-0flex-shrink: 0 → shrink-0
flexflex-1, flex-auto, flex-initial, flex-noneflex: 1 → flex-1
orderorder-1, order-first, order-lastorder: 1 → order-1
gapgap-4, gap-x-2, gap-y-4gap: 1rem → gap-4

🔹 Grid

CSS 속성Tailwind 유틸리티예시
grid-template-columnsgrid-cols-3, grid-cols-12grid-template-columns: repeat(3, 1fr) → grid-cols-3
grid-template-rowsgrid-rows-3, grid-rows-nonegrid-template-rows: repeat(3, 1fr) → grid-rows-3
grid-columncol-span-2, col-start-1, col-end-3grid-column: span 2 → col-span-2
grid-rowrow-span-2, row-start-1, row-end-3grid-row: span 2 → row-span-2
grid-auto-flowgrid-flow-row, grid-flow-col, grid-flow-densegrid-auto-flow: column → grid-flow-col

🔹 간격 (Spacing)

CSS 속성Tailwind 유틸리티예시
paddingp-4, px-2, py-4, pt-2, pr-2, pb-2, pl-2padding: 1rem → p-4
marginm-4, mx-2, my-4, mt-2, mr-2, mb-2, ml-2, -m-4margin: 1rem → m-4
space-betweenspace-x-4, space-y-4(자식 요소 간격)

🔹 크기 (Sizing)

CSS 속성Tailwind 유틸리티예시
widthw-full, w-1/2, w-64, w-auto, w-screenwidth: 100% → w-full
min-widthmin-w-0, min-w-full, min-w-minmin-width: 100% → min-w-full
max-widthmax-w-xs, max-w-md, max-w-full, max-w-screen-xlmax-width: 100% → max-w-full
heighth-full, h-screen, h-64, h-autoheight: 100% → h-full
min-heightmin-h-0, min-h-full, min-h-screenmin-height: 100vh → min-h-screen
max-heightmax-h-full, max-h-screenmax-height: 100% → max-h-full

🔹 타이포그래피 (Typography)

CSS 속성Tailwind 유틸리티예시
font-familyfont-sans, font-serif, font-monofont-family: sans-serif → font-sans
font-sizetext-xs, text-sm, text-base, text-lg, text-xl, text-2xlfont-size: 1rem → text-base
font-weightfont-thin, font-normal, font-medium, font-bold, font-blackfont-weight: bold → font-bold
font-styleitalic, not-italicfont-style: italic → italic
line-heightleading-none, leading-tight, leading-normal, leading-looseline-height: 1.5 → leading-normal
letter-spacingtracking-tighter, tracking-tight, tracking-normal, tracking-wideletter-spacing: 0.05em → tracking-wide
text-aligntext-left, text-center, text-right, text-justifytext-align: center → text-center
text-decorationunderline, line-through, no-underlinetext-decoration: underline → underline
text-transformuppercase, lowercase, capitalize, normal-casetext-transform: uppercase → uppercase
text-overflowtruncate, text-ellipsis, text-cliptext-overflow: ellipsis → truncate
white-spacewhitespace-normal, whitespace-nowrap, whitespace-prewhite-space: nowrap → whitespace-nowrap
word-breakbreak-normal, break-words, break-allword-break: break-all → break-all
vertical-alignalign-baseline, align-top, align-middle, align-bottomvertical-align: middle → align-middle

🔹 색상 (Colors)

CSS 속성Tailwind 유틸리티예시
colortext-black, text-white, text-red-500, text-blue-700color: #000 → text-black
background-colorbg-black, bg-white, bg-red-500, bg-transparentbackground-color: white → bg-white
border-colorborder-black, border-red-500, border-transparentborder-color: black → border-black
opacityopacity-0, opacity-50, opacity-100opacity: 0.5 → opacity-50

🔹 테두리 (Borders)

CSS 속성Tailwind 유틸리티예시
border-widthborder, border-0, border-2, border-t-2, border-r-2border-width: 1px → border
border-styleborder-solid, border-dashed, border-dotted, border-noneborder-style: solid → border-solid
border-radiusrounded, rounded-none, rounded-sm, rounded-lg, rounded-fullborder-radius: 0.25rem → rounded
border-radius (개별)rounded-t-lg, rounded-r-lg, rounded-tl-lgborder-top-left-radius: 0.5rem → rounded-tl-lg
outlineoutline-none, outline, outline-2outline: none → outline-none
outline-offsetoutline-offset-0, outline-offset-2outline-offset: 2px → outline-offset-2
ring-widthring, ring-0, ring-2, ring-inset(Tailwind 전용)
ring-colorring-black, ring-blue-500(Tailwind 전용)

🔹 효과 (Effects)

CSS 속성Tailwind 유틸리티예시
box-shadowshadow, shadow-sm, shadow-md, shadow-lg, shadow-nonebox-shadow: ... → shadow
opacityopacity-0, opacity-25, opacity-50, opacity-100opacity: 0.5 → opacity-50
mix-blend-modemix-blend-normal, mix-blend-multiply, mix-blend-overlaymix-blend-mode: multiply → mix-blend-multiply
background-blend-modebg-blend-normal, bg-blend-multiplybackground-blend-mode: multiply → bg-blend-multiply

🔹 필터 (Filters)

CSS 속성Tailwind 유틸리티예시
filter: blur()blur-none, blur-sm, blur, blur-lgfilter: blur(4px) → blur
filter: brightness()brightness-0, brightness-50, brightness-100filter: brightness(0.5) → brightness-50
filter: contrast()contrast-0, contrast-50, contrast-100filter: contrast(1.5) → contrast-150
filter: grayscale()grayscale-0, grayscalefilter: grayscale(1) → grayscale
filter: invert()invert-0, invertfilter: invert(1) → invert
filter: saturate()saturate-0, saturate-50, saturate-100filter: saturate(1.5) → saturate-150
filter: sepia()sepia-0, sepiafilter: sepia(1) → sepia
backdrop-filterbackdrop-blur, backdrop-brightness-50(backdrop 버전들)

🔹 전환 & 애니메이션 (Transitions & Animation)

CSS 속성Tailwind 유틸리티예시
transition-propertytransition, transition-none, transition-all, transition-colorstransition: all → transition-all
transition-durationduration-75, duration-100, duration-300, duration-1000transition-duration: 300ms → duration-300
transition-timing-functionease-linear, ease-in, ease-out, ease-in-outtransition-timing-function: ease-in → ease-in
transition-delaydelay-75, delay-100, delay-300transition-delay: 300ms → delay-300
animationanimate-none, animate-spin, animate-ping, animate-pulse, animate-bounce(미리 정의된 애니메이션)

🔹 Transform

CSS 속성Tailwind 유틸리티예시
transform: scale()scale-0, scale-50, scale-100, scale-150transform: scale(1.5) → scale-150
transform: rotate()rotate-0, rotate-45, rotate-90, rotate-180, -rotate-45transform: rotate(45deg) → rotate-45
transform: translate()translate-x-4, translate-y-4, -translate-x-1/2transform: translateX(1rem) → translate-x-4
transform: skew()skew-x-3, skew-y-3, -skew-x-6transform: skewX(3deg) → skew-x-3
transform-originorigin-center, origin-top, origin-top-righttransform-origin: center → origin-center

🔹 상호작용 (Interactivity)

CSS 속성Tailwind 유틸리티예시
cursorcursor-auto, cursor-pointer, cursor-not-allowed, cursor-waitcursor: pointer → cursor-pointer
pointer-eventspointer-events-none, pointer-events-autopointer-events: none → pointer-events-none
resizeresize-none, resize, resize-x, resize-yresize: none → resize-none
user-selectselect-none, select-text, select-all, select-autouser-select: none → select-none
scroll-behaviorscroll-auto, scroll-smoothscroll-behavior: smooth → scroll-smooth
touch-actiontouch-auto, touch-none, touch-pan-x, touch-pan-ytouch-action: none → touch-none

🔹 기타 (Miscellaneous)

CSS 속성Tailwind 유틸리티예시
visibilityvisible, invisiblevisibility: hidden → invisible
list-style-typelist-none, list-disc, list-decimallist-style-type: disc → list-disc
list-style-positionlist-inside, list-outsidelist-style-position: inside → list-inside
appearanceappearance-noneappearance: none → appearance-none
object-fitobject-contain, object-cover, object-fill, object-noneobject-fit: cover → object-cover
object-positionobject-center, object-top, object-bottomobject-position: center → object-center
aspect-ratioaspect-auto, aspect-square, aspect-videoaspect-ratio: 16/9 → aspect-video
contentcontent-nonecontent: "" → (사용 제한적)

🔹 @variant에서 사용 가능한 주요 변형(Variants)

  • hover - 마우스 오버 시
  • focus - 포커스 시
  • active - 활성화 시
  • disabled - 비활성화 시
  • visited - 방문한 링크
  • first - 첫 번째 자식
  • last - 마지막 자식
  • odd - 홀수 번째
  • even - 짝수 번째
  • dark - 다크 모드
  • sm, md, lg, xl, 2xl - 반응형 브레이크포인트
  • group-hover - 그룹 호버
  • peer-focus - 피어 포커스
profile
아무튼, 개발자

0개의 댓글