SVG

stroke

SVG 엘리먼트의 stroke 스타일을 지정하는 유틸리티입니다.

ClassStyles
stroke-none
stroke: none;
stroke-inherit
stroke: inherit;
stroke-current
stroke: currentColor;
stroke-transparent
stroke: transparent;
stroke-black
stroke: var(--color-black); /* #000 */
stroke-white
stroke: var(--color-white); /* #fff */
stroke-red-50
stroke: var(--color-red-50); /* oklch(0.971 0.013 17.38) */
stroke-red-100
stroke: var(--color-red-100); /* oklch(0.936 0.032 17.717) */
stroke-red-200
stroke: var(--color-red-200); /* oklch(0.885 0.062 18.334) */
stroke-red-300
stroke: var(--color-red-300); /* oklch(0.808 0.114 19.571) */

예제

기본 예제

stroke-indigo-500stroke-lime-600 같은 유틸리티를 사용해 SVG의 선 색상을 변경할 수 있습니다:

<svg class="stroke-cyan-500 ...">  <!-- ... --></svg>

이 방법은 Heroicons 같은 아이콘 세트를 스타일링할 때 유용합니다.

현재 색상 사용하기

stroke-current 유틸리티를 사용하면 스트로크 색상을 현재 텍스트 색상으로 설정할 수 있습니다:

버튼 위에 마우스를 올려 스트로크 색상이 변경되는 것을 확인하세요

<button class="bg-white text-pink-600 hover:bg-pink-600 hover:text-white ...">  <svg class="size-5 stroke-current ..." fill="none">    <!-- ... -->  </svg>  파일 다운로드</button>

커스텀 값 사용하기

stroke-[<value>] 구문을 사용하세요 stroke color를 완전히 커스텀한 값으로 설정하려면:

<svg class="stroke-[#243c5a] ...">  <!-- ... --></svg>

CSS 변수를 사용하려면 stroke-(<custom-property>) 구문을 사용할 수도 있습니다:

<svg class="stroke-(--my-stroke-color) ...">  <!-- ... --></svg>

이는 stroke-[var(<custom-property>)] 의 단축 표현으로, 자동으로 var() 함수를 추가해 줍니다.

반응형 디자인

접두사 a stroke 유틸리티 md:와 같은 브레이크포인트 변형과 함께 사용하면 medium 화면 크기 이상에서만 유틸리티가 적용됩니다:

<svg class="stroke-cyan-500 md:stroke-cyan-700 ...">  <!-- ... --></svg>

변형 사용에 대해 더 알아보려면 변형 문서를 참고하세요.

테마 커스터마이징

--color-* 테마 변수를 사용해 프로젝트에서 color 유틸리티를 커스터마이징할 수 있습니다:

@theme {  --color-regal-blue: #243c5a; }

이제 stroke-regal-blue 유틸리티를 마크업에서 사용할 수 있습니다:

<svg class="stroke-regal-blue">  <!-- ... --></svg>

테마 커스터마이징에 대해 더 알아보려면 테마 문서를 참고하세요.

Copyright © 2025 Tailwind Labs Inc.·Trademark Policy