Quick reference

Class
Properties
border-spacing-0border-spacing: 0px 0px;
border-spacing-x-0border-spacing: 0px var(--tw-border-spacing-y);
border-spacing-y-0border-spacing: var(--tw-border-spacing-x) 0px;
border-spacing-pxborder-spacing: 1px 1px;
border-spacing-x-pxborder-spacing: 1px var(--tw-border-spacing-y);
border-spacing-y-pxborder-spacing: var(--tw-border-spacing-x) 1px;
border-spacing-0.5border-spacing: 0.125rem 0.125rem;
border-spacing-x-0.5border-spacing: 0.125rem var(--tw-border-spacing-y);
border-spacing-y-0.5border-spacing: var(--tw-border-spacing-x) 0.125rem;
border-spacing-1border-spacing: 0.25rem 0.25rem;
border-spacing-x-1border-spacing: 0.25rem var(--tw-border-spacing-y);
border-spacing-y-1border-spacing: var(--tw-border-spacing-x) 0.25rem;
border-spacing-1.5border-spacing: 0.375rem 0.375rem;
border-spacing-x-1.5border-spacing: 0.375rem var(--tw-border-spacing-y);
border-spacing-y-1.5border-spacing: var(--tw-border-spacing-x) 0.375rem;
border-spacing-2border-spacing: 0.5rem 0.5rem;
border-spacing-x-2border-spacing: 0.5rem var(--tw-border-spacing-y);
border-spacing-y-2border-spacing: var(--tw-border-spacing-x) 0.5rem;
border-spacing-2.5border-spacing: 0.625rem 0.625rem;
border-spacing-x-2.5border-spacing: 0.625rem var(--tw-border-spacing-y);
border-spacing-y-2.5border-spacing: var(--tw-border-spacing-x) 0.625rem;
border-spacing-3border-spacing: 0.75rem 0.75rem;
border-spacing-x-3border-spacing: 0.75rem var(--tw-border-spacing-y);
border-spacing-y-3border-spacing: var(--tw-border-spacing-x) 0.75rem;
border-spacing-3.5border-spacing: 0.875rem 0.875rem;
border-spacing-x-3.5border-spacing: 0.875rem var(--tw-border-spacing-y);
border-spacing-y-3.5border-spacing: var(--tw-border-spacing-x) 0.875rem;
border-spacing-4border-spacing: 1rem 1rem;
border-spacing-x-4border-spacing: 1rem var(--tw-border-spacing-y);
border-spacing-y-4border-spacing: var(--tw-border-spacing-x) 1rem;
border-spacing-5border-spacing: 1.25rem 1.25rem;
border-spacing-x-5border-spacing: 1.25rem var(--tw-border-spacing-y);
border-spacing-y-5border-spacing: var(--tw-border-spacing-x) 1.25rem;
border-spacing-6border-spacing: 1.5rem 1.5rem;
border-spacing-x-6border-spacing: 1.5rem var(--tw-border-spacing-y);
border-spacing-y-6border-spacing: var(--tw-border-spacing-x) 1.5rem;
border-spacing-7border-spacing: 1.75rem 1.75rem;
border-spacing-x-7border-spacing: 1.75rem var(--tw-border-spacing-y);
border-spacing-y-7border-spacing: var(--tw-border-spacing-x) 1.75rem;
border-spacing-8border-spacing: 2rem 2rem;
border-spacing-x-8border-spacing: 2rem var(--tw-border-spacing-y);
border-spacing-y-8border-spacing: var(--tw-border-spacing-x) 2rem;
border-spacing-9border-spacing: 2.25rem 2.25rem;
border-spacing-x-9border-spacing: 2.25rem var(--tw-border-spacing-y);
border-spacing-y-9border-spacing: var(--tw-border-spacing-x) 2.25rem;
border-spacing-10border-spacing: 2.5rem 2.5rem;
border-spacing-x-10border-spacing: 2.5rem var(--tw-border-spacing-y);
border-spacing-y-10border-spacing: var(--tw-border-spacing-x) 2.5rem;
border-spacing-11border-spacing: 2.75rem 2.75rem;
border-spacing-x-11border-spacing: 2.75rem var(--tw-border-spacing-y);
border-spacing-y-11border-spacing: var(--tw-border-spacing-x) 2.75rem;
border-spacing-12border-spacing: 3rem 3rem;
border-spacing-x-12border-spacing: 3rem var(--tw-border-spacing-y);
border-spacing-y-12border-spacing: var(--tw-border-spacing-x) 3rem;
border-spacing-14border-spacing: 3.5rem 3.5rem;
border-spacing-x-14border-spacing: 3.5rem var(--tw-border-spacing-y);
border-spacing-y-14border-spacing: var(--tw-border-spacing-x) 3.5rem;
border-spacing-16border-spacing: 4rem 4rem;
border-spacing-x-16border-spacing: 4rem var(--tw-border-spacing-y);
border-spacing-y-16border-spacing: var(--tw-border-spacing-x) 4rem;
border-spacing-20border-spacing: 5rem 5rem;
border-spacing-x-20border-spacing: 5rem var(--tw-border-spacing-y);
border-spacing-y-20border-spacing: var(--tw-border-spacing-x) 5rem;
border-spacing-24border-spacing: 6rem 6rem;
border-spacing-x-24border-spacing: 6rem var(--tw-border-spacing-y);
border-spacing-y-24border-spacing: var(--tw-border-spacing-x) 6rem;
border-spacing-28border-spacing: 7rem 7rem;
border-spacing-x-28border-spacing: 7rem var(--tw-border-spacing-y);
border-spacing-y-28border-spacing: var(--tw-border-spacing-x) 7rem;
border-spacing-32border-spacing: 8rem 8rem;
border-spacing-x-32border-spacing: 8rem var(--tw-border-spacing-y);
border-spacing-y-32border-spacing: var(--tw-border-spacing-x) 8rem;
border-spacing-36border-spacing: 9rem 9rem;
border-spacing-x-36border-spacing: 9rem var(--tw-border-spacing-y);
border-spacing-y-36border-spacing: var(--tw-border-spacing-x) 9rem;
border-spacing-40border-spacing: 10rem 10rem;
border-spacing-x-40border-spacing: 10rem var(--tw-border-spacing-y);
border-spacing-y-40border-spacing: var(--tw-border-spacing-x) 10rem;
border-spacing-44border-spacing: 11rem 11rem;
border-spacing-x-44border-spacing: 11rem var(--tw-border-spacing-y);
border-spacing-y-44border-spacing: var(--tw-border-spacing-x) 11rem;
border-spacing-48border-spacing: 12rem 12rem;
border-spacing-x-48border-spacing: 12rem var(--tw-border-spacing-y);
border-spacing-y-48border-spacing: var(--tw-border-spacing-x) 12rem;
border-spacing-52border-spacing: 13rem 13rem;
border-spacing-x-52border-spacing: 13rem var(--tw-border-spacing-y);
border-spacing-y-52border-spacing: var(--tw-border-spacing-x) 13rem;
border-spacing-56border-spacing: 14rem 14rem;
border-spacing-x-56border-spacing: 14rem var(--tw-border-spacing-y);
border-spacing-y-56border-spacing: var(--tw-border-spacing-x) 14rem;
border-spacing-60border-spacing: 15rem 15rem;
border-spacing-x-60border-spacing: 15rem var(--tw-border-spacing-y);
border-spacing-y-60border-spacing: var(--tw-border-spacing-x) 15rem;
border-spacing-64border-spacing: 16rem 16rem;
border-spacing-x-64border-spacing: 16rem var(--tw-border-spacing-y);
border-spacing-y-64border-spacing: var(--tw-border-spacing-x) 16rem;
border-spacing-72border-spacing: 18rem 18rem;
border-spacing-x-72border-spacing: 18rem var(--tw-border-spacing-y);
border-spacing-y-72border-spacing: var(--tw-border-spacing-x) 18rem;
border-spacing-80border-spacing: 20rem 20rem;
border-spacing-x-80border-spacing: 20rem var(--tw-border-spacing-y);
border-spacing-y-80border-spacing: var(--tw-border-spacing-x) 20rem;
border-spacing-96border-spacing: 24rem 24rem;
border-spacing-x-96border-spacing: 24rem var(--tw-border-spacing-y);
border-spacing-y-96border-spacing: var(--tw-border-spacing-x) 24rem;

Basic usage

테이블 셀 간격 설정하기

분리된 테두리를 가진 테이블 셀 간의 간격을 조절하려면 border-spacing-*, border-spacing-x-*, border-spacing-y-* 유틸리티를 사용하세요.

State City
Indiana Indianapolis
Ohio Columbus
Michigan Detroit
<table class="border-separate border-spacing-2 border border-slate-400 ...">
  <thead>
    <tr>
      <th class="border border-slate-300 ...">State</th>
      <th class="border border-slate-300 ...">City</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td class="border border-slate-300 ...">Indiana</td>
      <td class="border border-slate-300 ...">Indianapolis</td>
    </tr>
    <tr>
      <td class="border border-slate-300 ...">Ohio</td>
      <td class="border border-slate-300 ...">Columbus</td>
    </tr>
    <tr>
      <td class="border border-slate-300 ...">Michigan</td>
      <td class="border border-slate-300 ...">Detroit</td>
    </tr>
  </tbody>
</table>

Applying conditionally

호버, 포커스 및 기타 상태

Tailwind는 상태에 따라 유틸리티 클래스를 조건부로 적용할 수 있게 해줍니다. 예를 들어, hover:border-spacing-2 를 사용하면 border-spacing-2 유틸리티를 hover 상태에서만 적용할 수 있습니다.

<table class="hover:border-spacing-2">
  <!-- ... -->
</table>

사용 가능한 모든 상태 수정자 목록은 호버, 포커스, & 기타 상태 문서를 참고하세요.

브레이크포인트와 미디어 쿼리

여러분은 반응형 브레이크포인트, 다크 모드, prefers-reduced-motion 등과 같은 미디어 쿼리를 타겟팅하기 위해 변형 수식어를 사용할 수 있습니다. 예를 들어, md:border-spacing-4를 사용하면 중간 화면 크기 이상에서만 border-spacing-4 유틸리티를 적용할 수 있습니다.

<table class="md:border-spacing-4">
  <!-- ... -->
</table>

더 자세히 알아보려면 반응형 디자인, 다크 모드, 그리고 다른 미디어 쿼리 수식어에 대한 문서를 확인하세요.


Using custom values

테마 커스터마이징

기본적으로 Tailwind의 border spacing 유틸리티는 기본 간격 스케일을 사용합니다. tailwind.config.js 파일에서 theme.spacing 또는 theme.extend.spacing을 수정하여 간격 스케일을 커스터마이징할 수 있습니다.

tailwind.config.js
module.exports = {
  theme: {
    extend: {
      spacing: {
        '13': '3.25rem',
      }
    }
  }
}

또는 tailwind.config.js 파일에서 theme.borderSpacing 또는 theme.extend.borderSpacing을 수정하여 border spacing 스케일만 커스터마이징할 수도 있습니다.

tailwind.config.js
module.exports = {
  theme: {
    extend: {
      borderSpacing: {
        '13': '3.25rem',
      },
    }
  }
}

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

임의 값

테마에 포함시키기 어려운 border-spacing 값을 일회성으로 사용해야 한다면, 대괄호를 사용해 임의의 값으로 속성을 즉석에서 생성할 수 있습니다.

<div class="border-spacing-[7px]">
  <!-- ... -->
</div>

임의 값 지원에 대해 더 알아보려면 임의 값 문서를 참고하세요.